MCPcopy
hub / github.com/dvajs/dva / take

Function take

packages/dva-core/src/getSaga.js:123–140  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

121 put.resolve = putResolve;
122
123 function take(type) {
124 if (typeof type === 'string') {
125 assertAction(type, 'sagaEffects.take');
126 return sagaEffects.take(prefixType(type, model));
127 } else if (Array.isArray(type)) {
128 return sagaEffects.take(
129 type.map(t => {
130 if (typeof t === 'string') {
131 assertAction(t, 'sagaEffects.take');
132 return prefixType(t, model);
133 }
134 return t;
135 })
136 );
137 } else {
138 return sagaEffects.take(type);
139 }
140 }
141 return { ...sagaEffects, put, take };
142}
143

Callers 3

testFunction · 0.85
effects.test.jsFile · 0.85
model.test.jsFile · 0.85

Calls 2

assertActionFunction · 0.85
prefixTypeFunction · 0.85

Tested by 1

testFunction · 0.68