Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Oct 9, 2016
1 parent 5f0596f commit 58c27b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/createDva.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function createDva(createOpts) {
// get reducers and sagas from model
let sagas = [];
let reducers = { ...initialReducer };
for (const m of this._models) {
for (let m of this._models) {
reducers[m.namespace] = getReducer(m.reducers, m.state);
if (m.effects) sagas.push(getSaga(m.effects, m, onErrorWrapper));
}
Expand Down Expand Up @@ -150,7 +150,7 @@ export default function createDva(createOpts) {

// store change
const listeners = plugin.get('onStateChange');
for (const listener of listeners) {
for (let listener of listeners) {
store.subscribe(listener);
}

Expand All @@ -161,7 +161,7 @@ export default function createDva(createOpts) {
if (setupHistory) setupHistory.call(this, history);

// run subscriptions
for (const model of this._models) {
for (let model of this._models) {
if (model.subscriptions) {
runSubscriptions(model.subscriptions, model, this, onErrorWrapper);
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export default function createDva(createOpts) {

function getSaga(effects, model, onError) {
return function *() {
for (const key in effects) {
for (let key in effects) {
const watcher = getWatcher(key, effects[key], model, onError);
yield sagaEffects.fork(watcher);
}
Expand Down Expand Up @@ -328,7 +328,7 @@ export default function createDva(createOpts) {
}

function runSubscriptions(subs, model, app, onError) {
for (const key in subs) {
for (let key in subs) {
const sub = subs[key];
invariant(typeof sub === 'function', 'app.start: subscription should be function');
sub({
Expand Down Expand Up @@ -373,7 +373,7 @@ export default function createDva(createOpts) {
}

function applyOnEffect(fns, effect, model, key) {
for (const fn of fns) {
for (let fn of fns) {
effect = fn(effect, sagaEffects, model, key);
}
return effect;
Expand Down

0 comments on commit 58c27b6

Please sign in to comment.