This file contains 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
var Alt = require('alt'); | |
var alt = new Alt(); | |
function Actions() { } | |
Actions.prototype.fetchSomething = function () { | |
return new Promise(function (resolve, reject) { | |
setTimeout(function () { | |
this.dispatch('value'); | |
resolve('value'); | |
}.bind(this), 100); |
This file contains 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
var Alt = require('./') | |
var alt = new Alt() | |
var actions = alt.generateActions('fire') | |
function MyStore() { | |
return { | |
displayName: 'MyStore', |
This file contains 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 actions from './actions' | |
export const bindListeners = { | |
handleClick: actions.FIRE | |
} | |
export const state = { | |
data: 1 | |
} |
This file contains 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
class FooActions { | |
action1() { } | |
action2() { } | |
action3() { } | |
mainAction() { | |
this.actions.action1(); | |
this.actions.action2(); | |
this.actions.action3(); |
This file contains 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
const Immutable = require('immutable'); | |
const Alt = require('alt'); | |
const alt = new Alt(); | |
const actions = alt.generateActions('fire'); | |
const store = alt.createStore({ | |
displayName: 'ImmutableStore', |
This file contains 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
var AppDispatcher = require('./dispatcher.js'); | |
var TodoActions = { | |
create(text) { | |
AppDispatcher.dispatch({ | |
actionType: 'CREATE_TODO' | |
text: text | |
}); | |
} | |
}; |
This file contains 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
const Alt = require('./') | |
const Immutable = require('immutable') | |
const ImmutableUtil = require('./utils/ImmutableUtil') | |
const alt = new Alt() | |
const actions = alt.generateActions('fire') | |
const assign = require('object-assign') |
This file contains 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
const Alt = require('./') | |
const Immutable = require('immutable') | |
const ImmutableUtil = require('./utils/ImmutableUtil') | |
const alt = new Alt() | |
const actions = alt.generateActions('fire') | |
const assign = require('object-assign') |
This file contains 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
const ImmutableUtil = require('./utils/ImmutableUtil') | |
const Immutable = require('immutable') | |
const Alt = require('./') | |
const alt = new Alt() | |
const actions = alt.generateActions('fire') | |
//function ImmutableStore() { | |
// this.handleFoo = function (x) { |
This file contains 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
Why did Alt not go with extends and super? | |
Why does alt not have a `getInitialState` method? | |
A principles of flux. | |
If using React 0.13 and no auto-binding remember to bind. |