You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@component()
@view(` <div class="foo"> <com-loader></com-loader> <com-foo></com-foo> </div>`)classFoo{// fetch event bubbles over .loader an event with promise as value. // If Promise resolved then onFetch will be called
@on('fetch com-loader') @thenonFetch({ result }){}
@on('ready com-foo') @thenonReady({ result }){}// eventA, eventB and eventC send an promise through the event.// only when the promises (internal promise.all) resolved onAbc will be called
@subscribe('eventA, eventB, eventC') @thenonAbc({ resA, resB, resC }){}}// orletcomponent=Comfoo.create();component.ready.then(()=>{// awesome code});// or for subscriberpubsub.publish('eventA',newPromise((resolve,reject)=>setTimeout(resolve,5000)));pubsub.publish('eventB',newPromise((resolve,reject)=>setTimeout(resolve,2000)));pubsub.publish('eventC',newPromise((resolve,reject)=>setTimeout(resolve,3000)));
The text was updated successfully, but these errors were encountered:
SerkanSipahi
changed the title
Using more Promises in project
Using more Promises ( finding ideas )
Oct 5, 2016
Ideas
The text was updated successfully, but these errors were encountered: