Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Observable<dynamic> _simulationStartEpic(
- Stream<dynamic> actions, EpicStore<AppState> epicStore) {
- return Observable(actions)
- .ofType(TypeToken<SimulationStateChangedAction>())
- .doOnData((action) {
- _simulationStateSubject.add(action.simulationState);
- }).switchMap((SimulationStateChangedAction action) {
- if (action.simulationState == SimulationState.ENABLED) {
- return _debouncedSummary()
- .takeUntil(_simulationStateSubject.takeWhile(
- (currentState) => currentState == SimulationState.DISABLED))
- .map((summary) => AddEntryAction(summary));
- } else {
- return Observable.empty();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement