-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(rstream): update types/generics
- remove default generics from ISubscription due to inference troubles - add ITransformable.map() - fix unsubscribe() arg types in various classes - update tests (generics only)
- Loading branch information
1 parent
36bff90
commit c982288
Showing
9 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import * as assert from "assert"; | ||
import { ISubscription, State } from "../src"; | ||
|
||
export const assertState = (x: ISubscription, state: State) => | ||
export const assertState = (x: ISubscription<any, any>, state: State) => | ||
assert.strictEqual(x.getState(), state, `${x.id} != ${State[state]}`); | ||
|
||
export const assertIdle = (x: ISubscription) => assertState(x, State.IDLE); | ||
export const assertIdle = (x: ISubscription<any, any>) => | ||
assertState(x, State.IDLE); | ||
|
||
export const assertActive = (x: ISubscription) => assertState(x, State.ACTIVE); | ||
export const assertActive = (x: ISubscription<any, any>) => | ||
assertState(x, State.ACTIVE); | ||
|
||
export const assertDone = (x: ISubscription) => assertState(x, State.DONE); | ||
export const assertDone = (x: ISubscription<any, any>) => | ||
assertState(x, State.DONE); | ||
|
||
export const assertUnsub = (x: ISubscription) => | ||
export const assertUnsub = (x: ISubscription<any, any>) => | ||
assertState(x, State.UNSUBSCRIBED); | ||
|
||
export const assertError = (x: ISubscription) => assertState(x, State.ERROR); | ||
export const assertError = (x: ISubscription<any, any>) => | ||
assertState(x, State.ERROR); |