Skip to content

Instantly share code, notes, and snippets.

@arqex
Created May 16, 2017 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arqex/30832c12d2d73daa6934762a1f0b9cdc to your computer and use it in GitHub Desktop.
Save arqex/30832c12d2d73daa6934762a1f0b9cdc to your computer and use it in GitHub Desktop.
Message reaction 2
freezer.on('message:loadAll', () => {
freezer.get().set({status: 'LOADING'});
Ajax.get('/messages').then( messages => {
freezer.get.set({
status: 'READY',
messages: messages
});
// Some other reactions might be listening to this
freezer.emit('message:loaded', messages );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment