Last active
November 15, 2017 23:20
-
-
Save alarner/03019b9a8a7fd47783cb8dff3e6370b0 to your computer and use it in GitHub Desktop.
AU Flux Basic Example
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 { Store } from 'au-flux'; | |
const LikeCount = Store.build({ | |
add_like: { | |
run(resolve, reject, action) { | |
resolve(this.value() + 1); | |
} | |
} | |
}); | |
export default new LikeCount(0); |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Button from './ButtonComponent'; | |
import { globals } from 'au-flux'; | |
import stores from './stores'; | |
globals.set('stores', stores); | |
ReactDOM.render(<Button />, document.getElementById('main')); |
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 likeCount from './likeCount'; | |
export default { | |
likeCount | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment