piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 98 forks source link

Simple Epic (listen to action and mapTo action) fails #174

Closed rahulthewall closed 5 years ago

rahulthewall commented 5 years ago

I have this fairly simple epic

const takeBreakEpic: Epic<RootAction, RootAction> = (action$) =>
  action$.pipe(
    filter(isActionOf(toggleBreakAction)),
    mapTo(logoutAction())
  );

I can't get this to work, it fails with the following error message

Error: Argument contains array with invalid element at index 0, it should be an action-creator instance from "typesafe-actions"

Is this a bug in the library?

rahulthewall commented 5 years ago

Was using action to create the action instead of createAction. Should RTFM.