Created
May 24, 2017 12:53
-
-
Save gorshkov-leonid/9cda13bca64044e74d2af3d01245cd33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let activeTasks: Array<Observable<Action>> = []; | |
// return action$.ofType(AppActions.LOAD_WIZARD_STATE_DEFERRED) | |
// .map((action: ActualizeWizardAfterAction) => { | |
// let subject = new Subject<Action>(); | |
// action.observable.subscribe(subject); | |
// return {observable: subject, sessionToken: action.sessionToken}; | |
// }) | |
// .flatMap((action: { observable: Observable<Action>, sessionToken: string }) => { | |
// const observable: Observable<Action> = action.observable.take(1); | |
// activeTasks.push(observable); | |
// | |
// const sessionToken = action.sessionToken; | |
// return observable.flatMap((a) => { | |
// if (activeTasks.length === 0) { | |
// throw Error("Implementation error: planned tasks list is empty but currently runned this task"); | |
// } | |
// if (activeTasks.length > 1) { | |
// return Observable.empty(); | |
// } | |
// return this.loadingService.getWizardState(sessionToken).map((wizardState) => AppActions.wizardStateLoaded(wizardState)); | |
// }).finally(()=>{ | |
// let index = activeTasks.indexOf(observable); | |
// if (index === -1) { | |
// throw Error("....."); | |
// } | |
// activeTasks.splice(index, 1); | |
// }); | |
// }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment