( effectActions: OriginalEffectActions<State>, state$: Observable<State>, )
| 201 | } |
| 202 | |
| 203 | function setupEffectActions<State>( |
| 204 | effectActions: OriginalEffectActions<State>, |
| 205 | state$: Observable<State>, |
| 206 | ): [Observable<Action<State>>, TriggerActions] { |
| 207 | const actions: TriggerActions = {} |
| 208 | const effects: Observable<Action<State>>[] = [] |
| 209 | |
| 210 | Object.keys(effectActions).forEach((actionName) => { |
| 211 | const payload$ = new Subject<any>() |
| 212 | actions[actionName] = (payload: any) => payload$.next(payload) |
| 213 | |
| 214 | const effect$: Observable<EffectAction> = effectActions[actionName](payload$, state$) |
| 215 | effects.push( |
| 216 | effect$.pipe( |
| 217 | map( |
| 218 | (effectAction): Action<State> => ({ |
| 219 | effectAction, |
| 220 | originalActionName: actionName, |
| 221 | }), |
| 222 | ), |
| 223 | catchRxError(), |
| 224 | ), |
| 225 | ) |
| 226 | }) |
| 227 | |
| 228 | return [merge(...effects), actions] |
| 229 | } |
| 230 | |
| 231 | function setupReducerActions<State>( |
| 232 | reducerActions: OriginalReducerActions<State>, |
no test coverage detected