| 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 | |