Skip to content

Instantly share code, notes, and snippets.

@mottaquikarim
mottaquikarim / dispatcher.js
Created June 23, 2017 14:42 — forked from whyu/dispatcher.js
Wrap flux dispatcher
function wrapFlux(MainApp, availableActions, defaultStore) {
return React.createClass({
getInitialState: function() {
return $.extend({}, defaultStore, this.props.additionalData);
},
dispatcher: function(action, extras) {
// if an array of actions is passed in
if (Array.isArray(action)) {
var promiseArr = []; // Create Promise Array
@mottaquikarim
mottaquikarim / 0_reuse_code.js
Created February 22, 2017 15:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console