Skip to content

Commit

Permalink
Merge pull request #313 from kristenmills/fix-channel-typing
Browse files Browse the repository at this point in the history
Fix the typing of effects that take Channels
  • Loading branch information
jp928 committed Oct 18, 2019
2 parents 20ccd58 + 1d3921d commit 7923b40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions effects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* There is no js module backing this up.
*/
import { Action } from 'redux';
import { Task, Channel, Buffer } from 'redux-saga';
import { Task, TakeableChannel, FlushableChannel, Buffer } from 'redux-saga';
import * as E from 'redux-saga/effects';

// Gives you the type of a field K in type T
type FieldType<T, K extends keyof T> = T[K];

interface TakeEffectApi<R> {
<T>(pattern?: E.Pattern<T>): R;
<T>(channel: Channel<T>): R;
<T>(channel: TakeableChannel<T>): R;
}
interface PutEffectApi<R> {
<A extends Action>(action: A): R;
Expand Down Expand Up @@ -46,7 +46,7 @@ interface EffectApi<R> {
all(effects: E.Effect[]): R;
cancel(task: Task): R;
cancelled(): R;
flush(channel: Channel<any>): R;
flush(channel: FlushableChannel<any>): R;
join(...tasks: Task[]): R;
delay(ms: number, val?: any): R;
}
Expand Down

0 comments on commit 7923b40

Please sign in to comment.