@cycle/run
Advanced tools
Comparing version 5.1.0-rc.0 to 5.1.0-rc.1
@@ -32,3 +32,5 @@ import { Stream } from 'xstream'; | ||
export declare type MatchingMain<D extends Drivers, M extends Main> = Main & { | ||
(so?: Partial<Sources<D>>): Sinks<M>; | ||
(so: Sources<D>): Sinks<M>; | ||
} | Main & { | ||
(): Sinks<M>; | ||
}; | ||
@@ -35,0 +37,0 @@ export declare type MatchingDrivers<D extends Drivers, M extends Main> = Drivers & { |
@@ -32,3 +32,5 @@ import { Stream } from 'xstream'; | ||
export declare type MatchingMain<D extends Drivers, M extends Main> = Main & { | ||
(so?: Partial<Sources<D>>): Sinks<M>; | ||
(so: Sources<D>): Sinks<M>; | ||
} | Main & { | ||
(): Sinks<M>; | ||
}; | ||
@@ -35,0 +37,0 @@ export declare type MatchingDrivers<D extends Drivers, M extends Main> = Drivers & { |
{ | ||
"name": "@cycle/run", | ||
"version": "5.1.0-rc.0", | ||
"version": "5.1.0-rc.1", | ||
"description": "The Cycle.js run() function to use with xstream", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -40,3 +40,5 @@ import {Stream} from 'xstream'; | ||
export type MatchingMain<D extends Drivers, M extends Main> = Main & { | ||
(so?: Partial<Sources<D>>): Sinks<M>; | ||
(so: Sources<D>): Sinks<M>; | ||
} | Main & { | ||
(): Sinks<M>; | ||
}; | ||
@@ -43,0 +45,0 @@ |
@@ -32,2 +32,24 @@ // tslint:disable-next-line | ||
it('should allow to not use all sources in main', function() { | ||
function app(so: {first: Stream<string>}) { | ||
return { | ||
first: xs.of('test'), | ||
second: xs.of('string') | ||
}; | ||
} | ||
function app2() { | ||
return { second: xs.of('test') }; | ||
} | ||
function driver(sink: Stream<string>) { | ||
return xs.of('answer'); | ||
} | ||
const {sinks, sources} = setup(app, {first: driver, second: driver}); | ||
const {sinks: sinks2, sources: sources2} = setup(app2, {first: driver, second: driver}); | ||
assert.strictEqual(typeof sinks, 'object'); | ||
assert.strictEqual(typeof sinks.second.addListener, 'function'); | ||
assert.strictEqual(typeof sinks2, 'object'); | ||
assert.strictEqual(typeof sinks2.second.addListener, 'function'); | ||
}); | ||
it('should return sinks object and sources object', function() { | ||
@@ -34,0 +56,0 @@ function app(ext: {other: Stream<string>}) { |
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
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
108760
2094