mirror of
https://github.com/wassname/generator-react-webpack.git
synced 2026-09-10 12:00:17 +08:00
Add flux support including generators
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var <% classedName + 'ActionCreators' %> = {
|
||||
|
||||
}
|
||||
|
||||
<% if (es6) { %> export default <%= classedName + 'ActionCreators' %>; <% }
|
||||
else { %>module.exports = <%= classedName + 'ActionCreators' %>; <% } %>
|
||||
@@ -0,0 +1,3 @@
|
||||
var Dispatcher = require('flux').Dispatcher;
|
||||
|
||||
module.exports = new Dispatcher();
|
||||
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var assign = require('object-assign');
|
||||
var <%= dispatcherName %> = require('../dispatcher/<%= dispatcherName %>');
|
||||
|
||||
var <%= classedName + 'Store' %> = assign({}, EventEmitter.prototype, {
|
||||
|
||||
});
|
||||
|
||||
<%= classedName + 'Store' %>.dispatchToken = <%= dispatcherName %>.register(function(action) {
|
||||
|
||||
switch(action.type) {
|
||||
default:
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
<% if (es6) { %> export default <%= classedName + 'Store' %>; <% }
|
||||
else { %>module.exports = <%= classedName + 'Store' %>; <% } %>
|
||||
Reference in New Issue
Block a user