Skip to content

Instantly share code, notes, and snippets.

@eduard-tkv
Last active April 16, 2017 18:55
Show Gist options
  • Save eduard-tkv/d5bea8443aa5921d06f7493dfbb4230f to your computer and use it in GitHub Desktop.
Save eduard-tkv/d5bea8443aa5921d06f7493dfbb4230f to your computer and use it in GitHub Desktop.
//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