chore(server): Move api-server in to it's own DIR
This commit is contained in:
committed by
mrugesh mohapatra
parent
9fba6bce4c
commit
46a217d0a5
15
api-server/common/utils/wait-for-epics.js
Normal file
15
api-server/common/utils/wait-for-epics.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { Observable } from 'rx';
|
||||
import debug from 'debug';
|
||||
|
||||
const log = debug('redux-epic:waitForEpics');
|
||||
|
||||
// waitForEpics(epicMiddleware: EpicMiddleware) => Observable[Void]
|
||||
export default function waitForEpics(epicMiddleware) {
|
||||
return Observable.defer(() => {
|
||||
log('calling actions onCompleted');
|
||||
epicMiddleware.end();
|
||||
return Observable.merge(epicMiddleware);
|
||||
})
|
||||
.last({ defaultValue: null })
|
||||
.map(() => epicMiddleware.restart());
|
||||
}
|
Reference in New Issue
Block a user