mirror of https://github.com/deavmi/eventy.git
Added usage of the `then` call
This commit is contained in:
parent
ac5c8dfcde
commit
ea60097153
11
README.md
11
README.md
|
@ -13,6 +13,17 @@ Eventy eventy = new Eventy();
|
|||
*/
|
||||
Promise myPromise = eventy.new((x) => (x*2));
|
||||
|
||||
/**
|
||||
* Chain a promise to this one such that upon completion of
|
||||
* `myPromise` then `promise2` will run and `myPromise` will only
|
||||
* be considered completely done once everything from its chain forward is
|
||||
*
|
||||
* NOTE: That a promise is only completed then once its chain forwards
|
||||
* is completed
|
||||
*/
|
||||
Promise promise2 = eventy.new((x)=>());
|
||||
myPromise.then(promise2);
|
||||
|
||||
/**
|
||||
* Now start the promise and await its completion,
|
||||
* this will basically sleep the calling thread
|
||||
|
|
Loading…
Reference in New Issue