wait-when
Execute when condition fulfill.
Usage
- Node
npm i wait-when
const Condition WaitWhen = ;
- Browser
It has a global variable "ww".
var Condition = wwCondition;var WaitWhen = wwWaitWhen;
API
1. Condition(fulfillValue,value)
var c = true false;
2. Condition.value
Set condition's value.
You can create a new value and assign to it.(Recommended)
For array and object value you can also change it directly.
(Warning:it's not perfect to detect array and object change)
cvalue = true;cvalue;cvaluekey = 'value';
3. WaitWhen
var ww = ;
4. WaitWhen.then(conditions,cb)
ww;ww;
Dependencies
I use Watch.JS to detect array and object change, lodash/isEqual to compare fulfillValue with value.
Build
If you want to build by yourself.please run
npm run build
Test
If you want to do the test.please run
npm test