@cycle/run
Advanced tools
Comparing version 5.1.0 to 5.2.0-rc.0
import { Stream } from 'xstream'; | ||
export interface FantasyObserver { | ||
next(x: any): void; | ||
export interface FantasyObserver<T> { | ||
next(x: T): void; | ||
error(err: any): void; | ||
@@ -10,4 +10,4 @@ complete(c?: any): void; | ||
} | ||
export interface FantasyObservable { | ||
subscribe(observer: FantasyObserver): FantasySubscription; | ||
export interface FantasyObservable<T> { | ||
subscribe(observer: FantasyObserver<T>): FantasySubscription; | ||
} | ||
@@ -20,8 +20,6 @@ export interface DevToolEnabledSource { | ||
}; | ||
export declare type Driver<Si, So> = { | ||
(stream?: Si, driverName?: string): So; | ||
}; | ||
export declare type Driver<Si, So> = Si extends void ? (() => So) : ((stream: Si) => So); | ||
export declare type DisposeFunction = () => void; | ||
export declare type Drivers = { | ||
[name: string]: Driver<Stream<any> | void, any | void>; | ||
[name: string]: Driver<Stream<any>, any | void>; | ||
}; | ||
@@ -38,4 +36,5 @@ export declare type Main = (...args: Array<any>) => any; | ||
}); | ||
export declare type ToStream<S> = S extends FantasyObservable<infer T> ? Stream<T> : S; | ||
export declare type MatchingDrivers<D extends Drivers, M extends Main> = Drivers & { | ||
[k in string & keyof Sinks<M>]: ((si?: Sinks<M>[k]) => Sources<D>[k]) | ((si: Sinks<M>[k]) => Sources<D>[k]); | ||
[k in string & keyof Sinks<M>]: (() => Sources<D>[k]) | ((si: ToStream<Sinks<M>[k]>) => Sources<D>[k]); | ||
}; | ||
@@ -42,0 +41,0 @@ export interface CycleProgram<D extends MatchingDrivers<D, M>, M extends MatchingMain<D, M>> { |
import { Stream } from 'xstream'; | ||
export interface FantasyObserver { | ||
next(x: any): void; | ||
export interface FantasyObserver<T> { | ||
next(x: T): void; | ||
error(err: any): void; | ||
@@ -10,4 +10,4 @@ complete(c?: any): void; | ||
} | ||
export interface FantasyObservable { | ||
subscribe(observer: FantasyObserver): FantasySubscription; | ||
export interface FantasyObservable<T> { | ||
subscribe(observer: FantasyObserver<T>): FantasySubscription; | ||
} | ||
@@ -20,8 +20,6 @@ export interface DevToolEnabledSource { | ||
}; | ||
export declare type Driver<Si, So> = { | ||
(stream?: Si, driverName?: string): So; | ||
}; | ||
export declare type Driver<Si, So> = Si extends void ? (() => So) : ((stream: Si) => So); | ||
export declare type DisposeFunction = () => void; | ||
export declare type Drivers = { | ||
[name: string]: Driver<Stream<any> | void, any | void>; | ||
[name: string]: Driver<Stream<any>, any | void>; | ||
}; | ||
@@ -38,4 +36,5 @@ export declare type Main = (...args: Array<any>) => any; | ||
}); | ||
export declare type ToStream<S> = S extends FantasyObservable<infer T> ? Stream<T> : S; | ||
export declare type MatchingDrivers<D extends Drivers, M extends Main> = Drivers & { | ||
[k in string & keyof Sinks<M>]: ((si?: Sinks<M>[k]) => Sources<D>[k]) | ((si: Sinks<M>[k]) => Sources<D>[k]); | ||
[k in string & keyof Sinks<M>]: (() => Sources<D>[k]) | ((si: ToStream<Sinks<M>[k]>) => Sources<D>[k]); | ||
}; | ||
@@ -42,0 +41,0 @@ export interface CycleProgram<D extends MatchingDrivers<D, M>, M extends MatchingMain<D, M>> { |
{ | ||
"name": "@cycle/run", | ||
"version": "5.1.0", | ||
"version": "5.2.0-rc.0", | ||
"description": "The Cycle.js run() function to use with xstream", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -31,3 +31,3 @@ import xs, {Stream} from 'xstream'; | ||
if (drivers.hasOwnProperty(name)) { | ||
sources[name as any] = drivers[name](sinkProxies[name], name); | ||
sources[name as any] = (drivers[name] as any)(sinkProxies[name], name); | ||
if (sources[name as any] && typeof sources[name as any] === 'object') { | ||
@@ -34,0 +34,0 @@ (sources[name as any] as DevToolEnabledSource)._isCycleSource = name; |
import {Stream} from 'xstream'; | ||
export interface FantasyObserver { | ||
next(x: any): void; | ||
export interface FantasyObserver<T> { | ||
next(x: T): void; | ||
error(err: any): void; | ||
@@ -13,4 +13,4 @@ complete(c?: any): void; | ||
export interface FantasyObservable { | ||
subscribe(observer: FantasyObserver): FantasySubscription; | ||
export interface FantasyObservable<T> { | ||
subscribe(observer: FantasyObserver<T>): FantasySubscription; | ||
} | ||
@@ -24,5 +24,5 @@ | ||
export type Driver<Si, So> = { | ||
(stream?: Si, driverName?: string): So; | ||
}; | ||
export type Driver<Si, So> = Si extends void | ||
? (() => So) | ||
: ((stream: Si) => So); | ||
@@ -32,3 +32,3 @@ export type DisposeFunction = () => void; | ||
export type Drivers = { | ||
[name: string]: Driver<Stream<any> | void, any | void>; | ||
[name: string]: Driver<Stream<any>, any | void>; | ||
}; | ||
@@ -50,7 +50,9 @@ | ||
export type ToStream<S> = S extends FantasyObservable<infer T> ? Stream<T> : S; | ||
export type MatchingDrivers<D extends Drivers, M extends Main> = Drivers & | ||
{ | ||
[k in string & keyof Sinks<M>]: | ||
| ((si?: Sinks<M>[k]) => Sources<D>[k]) | ||
| ((si: Sinks<M>[k]) => Sources<D>[k]) | ||
| (() => Sources<D>[k]) | ||
| ((si: ToStream<Sinks<M>[k]>) => Sources<D>[k]) | ||
}; | ||
@@ -57,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109927
46
2098
1