36 lines
920 B
CoffeeScript
36 lines
920 B
CoffeeScript
$ = jQuery
|
|
context = window
|
|
logger = context.JK.logger
|
|
broadcastActions = BroadcastNotificationActions # require('../actions/BroadcastNotificationActions')
|
|
|
|
rest = context.JK.Rest()
|
|
|
|
# see if this shows up elsewhere
|
|
broadcastActions.blah = 'hahah'
|
|
|
|
broadcastActions.load.listenAndPromise(rest.getBroadcastNotification);
|
|
|
|
console.log("broadcastActions!!", broadcastActions)
|
|
BroadcastNotificationStore = Reflux.createStore(
|
|
{
|
|
listenables: broadcastActions
|
|
|
|
init: () =>
|
|
logger.debug("broadcast notification store init")
|
|
#this.listenTo(broadcastActions.load, 'onSync')
|
|
|
|
onLoad: () =>
|
|
logger.debug("loading broadcast notification...")
|
|
|
|
onLoadCompleted: () =>
|
|
logger.debug("broadcast notification sync completed")
|
|
|
|
onLoadFailed: (jqXHR) =>
|
|
if jqXHR.status != 404
|
|
logger.error("broadcast notification sync failed")
|
|
}
|
|
)
|
|
|
|
module.exports = BroadcastNotificationStore
|
|
|