How to use the redux-observable.ActionsObservable.from function in redux-observable

To help you get started, we’ve selected a few redux-observable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simonccarter / react-conf-videos / src / redux / modules / bootstrap.spec.ts View on Github external
it('should return the correct action and payload', done => {
      // arrange
      const action$ = ActionsObservable.from(
        BOOTSTRAP_COMPLETE_ACTIONS.map(type => ({ type }))
      );

      // act
      bootstrapEndEpic(action$, mockStore(), null).subscribe(action => {
        // assert
        expect(action.type).toBe(BOOTSTRAP_END);
        expect(action.payload).toBeUndefined();
        done();
      });
    });
  });
github nteract / nteract / packages / core / __tests__ / epics / execute-spec.js View on Github external
kernels: stateModule.makeKernelsRecord({
              byRef: Immutable.Map({
                fake: stateModule.makeRemoteKernelRecord({
                  channels,
                  status: "connected"
                })
              })
            })
          })
        }),
        app: {
          notificationSystem: { addNotification: jest.fn() }
        }
      }
    };
    const action$ = ActionsObservable.from([]);
    const message = createExecuteRequest("source");

    const observable = createExecuteCellStream(
      action$,
      state$.value,
      message,
      "id"
    );
    const actionBuffer = [];
    observable.subscribe(x => actionBuffer.push(x), err => done.fail(err));
    expect(actionBuffer).toEqual([
      actions.sendExecuteRequest({ id: "id", message })
    ]);
    done();
  });
});
github nteract / nteract / packages / epics / __tests__ / execute.spec.ts View on Github external
kernels: stateModule.makeKernelsRecord({
              byRef: Immutable.Map({
                fake: stateModule.makeRemoteKernelRecord({
                  channels,
                  status: "connected"
                })
              })
            })
          })
        }),
        app: {
          notificationSystem: { addNotification: jest.fn() }
        }
      }
    };
    const action$ = ActionsObservable.from([]);
    const message = createExecuteRequest("source");

    const observable = createExecuteCellStream(
      action$,
      state$.value,
      message,
      "id",
      "fakeContentRef"
    );
    const actionBuffer = [];
    observable.subscribe(x => actionBuffer.push(x), err => done.fail(err));
    expect(actionBuffer).toEqual([
      actions.sendExecuteRequest({
        id: "id",
        message,
        contentRef: "fakeContentRef"