Slide 49
Slide 49 text
export const show = () !=>
({ type: 'SHOW' });
export const close = () !=>
({ type: 'CLOSE' });
export const delayEpic = action$ !=>
action$.ofType('SHOW')
.delay(3000)
.map(x !=> close());
test('test delay', () !=> {
expectedEpic(
delayEpic,
{
action: ['a', { a: show() }],
expect: ['(--a', { a: close() }],
},
mockDelay('(--|')
);
});
reducer.js reducer.test.js