Created
May 17, 2015 14:10
-
-
Save ALF-er/d604536b170dba72a43a to your computer and use it in GitHub Desktop.
rhcedispatcher.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dispatcher } from "flux"; | |
import assign from "react/lib/Object.assign"; | |
import { PayloadSources } from "constants/AppConstants"; | |
export default assign(new Dispatcher(), { | |
handleServerAction(type, result, error = null) { | |
let payload = { | |
source: PayloadSources.SERVER_ACTION, | |
action: { | |
type, | |
error, | |
result | |
} | |
}; | |
this.dispatch(payload); | |
console.log(type, payload); | |
}, | |
handleAppAction(type, result, error = null) { | |
var payload = { | |
source: PayloadSources.APP_ACTION, | |
action: { | |
type, | |
error, | |
result | |
} | |
}; | |
this.dispatch(payload); | |
console.log(type, payload); | |
}, | |
handleViewAction(type, result, error = null) { | |
var payload = { | |
source: PayloadSources.VIEW_ACTION, | |
action: { | |
type, | |
error, | |
result | |
} | |
}; | |
this.dispatch(payload); | |
console.log(type, payload); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment