If I have an object thats fetching data and it emits a "ready" event but another object starts listening for that event after it has already been fired is there a direct way of allowing that listener to receive that missed event.
Purely hypothetical example (so please don't ask why I would do this):
var dataModule = new DataModule(); // data fetching happens here.
setTimeout( function(){
dataModule.once( 'ready', function(){
// Perform some action when the data is ready
} );
}, 5000 ); // Five second delay
In the above example lets assume that DataModule
fetches it's data asynchronously and its really quick.
Aucun commentaire:
Enregistrer un commentaire