Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
/ Helpers.js Public archive

Collection of functions for rapid campaign development.

Notifications You must be signed in to change notification settings

tytskyi/Helpers.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to develop

  1. git clone https://github.com/tytskiy/Helpers.js.git
  2. npm i -g gulp
  3. npm i
  4. gulp

Usage

var helpers = new core.T0.Helpers();

// with reset timer
helpers.wait({
    freq: 100,
    reset: 3000,
    check: function () {
        return window.jQuery;
    },
    success: function () {
        console.log('jQuery was found')
    },
    fail: function () {
        console.log('jQuery wasn\'t found during 3 seconds')
    },
    always: function () {
        console.log('Anyway print something')
    }
});

// with reset function
helpers.wait({
    freq: 100,
    reset: function () {
        return 2 + 2 > -1;
    },
    check: function () {
        return window.Zepto;
    },
    success: function () {
        console.log('Zepto was found')
    },
    fail: function () {
        console.log('Zepto wasn\'t found')
    },
    always: function () {
        console.log('Anyway print something')
    }
});

TODO:

Add more examples

About

Collection of functions for rapid campaign development.

Resources

Stars

Watchers

Forks

Packages

No packages published