loadsync
Load and execute javascript code in web browser synchronously
Installation
(Your web fronend project should use npm to manage libraries)
$ npm install --save loadsync
Usage
Include loadsync
library:
var Loadsync = ;
Declare States and timeout:
var loadsync = name: 'TIMEOUT' cards: 'STATE1' 'STATE2' 'STATE3' timeout: 500 name: 'NO_TIMEOUT' cards: 'STATE3' 'STATE4' 'STATE5';
Or reset it:
// create empty loadsync instance// var loadsync = new Loadsync(); // reset steps and begin a new flowloadsync;
Define the ready callback function after all of states have been checked:
loadsync;
Check each state that has been done (STATE1
for example):
loadsync;
(the same with others: STATE2
, STATE3
):
loadsync;
loadsync;