Skip to content
Permalink
Browse files

fix(typings): Update type of Epic parameter from store to state$ (#465)

  • Loading branch information...
cjol authored and jayphelps committed Apr 5, 2018
1 parent 72bd9dc commit 6e9430dfecb7df3c567540c51cdf77ca30a07d91
Showing with 15 additions and 3 deletions.
  1. +15 −3 index.d.ts
@@ -1,5 +1,5 @@
import { Middleware, MiddlewareAPI, Action } from 'redux';
import { Observable, ObservableInput, Operator, SchedulerLike } from 'rxjs';
import { Middleware, MiddlewareAPI, Action, Store } from 'redux';
import { Observable, ObservableInput, Operator, SchedulerLike, Subject } from 'rxjs';

export declare class ActionsObservable<T extends Action> extends Observable<T> {
/**
@@ -26,8 +26,20 @@ export declare class ActionsObservable<T extends Action> extends Observable<T> {
ofType<R extends T = T>(...key: R['type'][]): ActionsObservable<R>;
}

export declare class StateObservable<S> extends Observable<S> {
source: Subject<S>;
constructor(stateSubject: Subject<S>, store: Store<S>);

value: S

// deprecated
getState(): S
dispatch: Store<S>["dispatch"]
}


export declare interface Epic<T extends Action, S, D = any, O extends T = T> {
(action$: ActionsObservable<T>, store: MiddlewareAPI<S>, dependencies: D): Observable<O>;
(action$: ActionsObservable<T>, state$: StateObservable<S>, dependencies: D): Observable<O>;
}

export interface EpicMiddleware<T extends Action, S, D = any, O extends T = T> extends Middleware {

0 comments on commit 6e9430d

Please sign in to comment.
You can’t perform that action at this time.