Skip to content

Commit

Permalink
enhance(take): saga-effect take should be able to take multi actions;
Browse files Browse the repository at this point in the history
  • Loading branch information
sjy committed May 2, 2018
1 parent e114cfb commit ae4653d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/dva-core/src/getSaga.js
Expand Up @@ -105,6 +105,16 @@ function createEffects(model) {
if (typeof type === 'string') {
assertAction(type, 'sagaEffects.take');
return sagaEffects.take(prefixType(type, model));
} else if (Array.isArray(type)) {
return sagaEffects.take(
type.map(t => {
if (typeof t === 'string') {
assertAction(t, 'sagaEffects.take');
return prefixType(type, model);
}
return t;
})
);
} else {
return sagaEffects.take(type);
}
Expand Down

0 comments on commit ae4653d

Please sign in to comment.