Created
July 29, 2015 16:09
-
-
Save isnifer/a8ccb6c515c9df680302 to your computer and use it in GitHub Desktop.
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 { Store } from 'flummox'; | |
class MainPageStore extends Store { | |
constructor (flux) { | |
super(); // Don't forget this step | |
const MainPageActionIds = flux.getActionIds('MainPage'); | |
this.register(MainPageActionIds.loadData, this.loadData); | |
this.register(MainPageActionIds.getTop, this.getTop); | |
this.state = { | |
giveaways: {}, | |
top: [], | |
footer: { | |
users: 160125, | |
giveaways: 160287, | |
money: 1130247 | |
} | |
}; | |
} | |
loadData (payload) { | |
this.setState({giveaways: payload}); | |
} | |
getTop (payload) { | |
this.setState({top: payload}); | |
} | |
} | |
export default MainPageStore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment