// Inspired by https://github.com/m0a/typescript-fsa-redux-observable
import { filter } from 'rxjs/operators';
export function ofAction(actionCreator) {
  return function (actions$) {
    return actions$.pipe(filter(actionCreator.match));
  };
}
export function ofActionWithPayload(actionCreator) {
  return function (actions$) {
    return actions$.pipe(filter(actionCreator.match), filter(function (action) {
      return action.payload !== null;
    }));
  };
}