Last active
April 16, 2017 18:55
-
-
Save eduard-tkv/d5bea8443aa5921d06f7493dfbb4230f 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
//constants/app-constants.js | |
let constants = { | |
INCREMENT: "INCREMENT" | |
}; | |
export default constants; | |
//dispatcher/dispatcher.js | |
import {Dispatcher} from 'flux'; | |
const dispatcher = new Dispatcher(); | |
export default dispatcher; | |
//actions/app-actions.js | |
import constants from '../constants/app-constants'; | |
import dispatcher from '../dispatcher/dispatcher'; | |
console.log(constants); | |
console.log(dispatcher); | |
export function testing(){ | |
} | |
//scr/index.js | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import {testing} from '../actions/app-actions'; | |
class App extends React.Component{ | |
...blah blah | |
} | |
ReactDOM.render( ...blah blah) | |
//console output: Object {INCREMENT: 'INCREMENT'} | |
//console output: Dispatcher{_callbacks: ...} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment