commit 43ecd6bc4f3acfaac511621f0f424642f1f4a622
parent e003c62cda746b70870b5c5f286301ad4a8533e7
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Wed, 20 May 2015 19:47:05 +0300
Move ActionTypes to src/constants
Diffstat:
7 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/README.md b/README.md
@@ -36,6 +36,7 @@
│ ├── /actions/ # Action creators that allow to trigger a dispatch to stores
│ ├── /assets/ # Static files which are copied to ./build on compile
│ ├── /components/ # React components
+│ ├── /constants/ # Constants (action types etc.)
│ ├── /content/ # Static content (plain HTML or Markdown, Jade, you name it)
│ ├── /core/ # Core components (Flux dispatcher, base classes, utilities)
│ ├── /stores/ # Stores contain the application state and logic
diff --git a/src/actions/AppActions.js b/src/actions/AppActions.js
@@ -3,7 +3,7 @@
import http from 'superagent';
import { canUseDOM } from 'react/lib/ExecutionEnvironment';
import Dispatcher from '../core/Dispatcher';
-import { ActionTypes } from '../core/Constants';
+import ActionTypes from '../constants/ActionTypes';
export default {
diff --git a/src/app.js b/src/app.js
@@ -6,7 +6,7 @@ import FastClick from 'fastclick';
import App from './components/App';
import Dispatcher from './core/Dispatcher';
import AppActions from './actions/AppActions';
-import { ActionTypes } from './core/Constants';
+import ActionTypes from './constants/ActionTypes';
let path = decodeURI(window.location.pathname);
let onSetMeta = (name, content) => {
diff --git a/src/constants/ActionTypes.js b/src/constants/ActionTypes.js
@@ -0,0 +1,9 @@
+/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
+
+import keyMirror from 'react/lib/keyMirror';
+
+export default keyMirror({
+ GET_PAGE: null,
+ RECEIVE_PAGE: null,
+ CHANGE_LOCATION: null
+});
diff --git a/src/core/Constants.js b/src/core/Constants.js
@@ -1,13 +0,0 @@
-/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
-
-import keyMirror from 'react/lib/keyMirror';
-
-export default {
-
- ActionTypes: keyMirror({
- GET_PAGE: null,
- RECEIVE_PAGE: null,
- CHANGE_LOCATION: null
- })
-
-};
diff --git a/src/core/Database.js b/src/core/Database.js
@@ -5,7 +5,7 @@ import path from 'path';
import jade from 'jade';
import fm from 'front-matter';
import Dispatcher from './Dispatcher';
-import { ActionTypes } from './Constants';
+import ActionTypes from '../constants/ActionTypes';
// A folder with Jade/Markdown/HTML content pages
const CONTENT_DIR = path.join(__dirname, './content');
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
@@ -2,7 +2,7 @@
import EventEmitter from 'eventemitter3';
import Dispatcher from '../core/Dispatcher';
-import { ActionTypes } from '../core/Constants.js';
+import ActionTypes from '../constants/ActionTypes';
const CHANGE_EVENT = 'change';