@cycle/run
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0-rc.2
@@ -0,1 +1,11 @@ | ||
<a name="1.0.0-rc.2"></a> | ||
# 1.0.0-rc.2 (2016-12-09) | ||
### Bug Fixes | ||
* **run:** use FantasyObservable in Sinks, not xstream Stream ([d68a50e](https://github.com/cyclejs/cyclejs/tree/master/run/commit/d68a50e)) | ||
<a name="1.0.0-rc.1"></a> | ||
@@ -2,0 +12,0 @@ # 1.0.0-rc.1 (2016-12-09) |
@@ -91,3 +91,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Cycle = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
* import {setup} from '@cycle/run'; | ||
* const {sources, sinks, run} = Cycle(main, drivers); | ||
* const {sources, sinks, run} = setup(main, drivers); | ||
* // ... | ||
@@ -94,0 +94,0 @@ * const dispose = run(); // Executes the application |
import { Stream } from 'xstream'; | ||
export interface FantasyObserver { | ||
next: (x: any) => void; | ||
error: (err: any) => void; | ||
complete: (c?: any) => void; | ||
} | ||
export interface FantasySubscription { | ||
unsubscribe: () => void; | ||
} | ||
export interface FantasyObservable { | ||
subscribe(observer: FantasyObserver): FantasySubscription; | ||
} | ||
export interface Sinks { | ||
[driverName: string]: FantasyObservable; | ||
} | ||
export interface XStreamSinks extends Sinks { | ||
[driverName: string]: Stream<any>; | ||
@@ -10,3 +24,3 @@ } | ||
export interface DriverFunction { | ||
(stream: Stream<any>, driverName: string): any; | ||
(stream: FantasyObservable, driverName: string): any; | ||
} | ||
@@ -32,3 +46,3 @@ export interface DriversDefinition { | ||
* import {setup} from '@cycle/run'; | ||
* const {sources, sinks, run} = Cycle(main, drivers); | ||
* const {sources, sinks, run} = setup(main, drivers); | ||
* // ... | ||
@@ -35,0 +49,0 @@ * const dispose = run(); // Executes the application |
@@ -89,3 +89,3 @@ "use strict"; | ||
* import {setup} from '@cycle/run'; | ||
* const {sources, sinks, run} = Cycle(main, drivers); | ||
* const {sources, sinks, run} = setup(main, drivers); | ||
* // ... | ||
@@ -92,0 +92,0 @@ * const dispose = run(); // Executes the application |
{ | ||
"name": "@cycle/run", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0-rc.2", | ||
"description": "The Cycle.js run() function to use with xstream", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -36,3 +36,3 @@ # Run() for xstream | ||
import {setup} from '@cycle/run'; | ||
const {sources, sinks, run} = Cycle(main, drivers); | ||
const {sources, sinks, run} = setup(main, drivers); | ||
// ... | ||
@@ -39,0 +39,0 @@ const dispose = run(); // Executes the application |
import xs, {Stream} from 'xstream'; | ||
export interface FantasyObserver { | ||
next: (x: any) => void; | ||
error: (err: any) => void; | ||
complete: (c?: any) => void; | ||
} | ||
export interface FantasySubscription { | ||
unsubscribe: () => void; | ||
} | ||
export interface FantasyObservable { | ||
subscribe(observer: FantasyObserver): FantasySubscription; | ||
} | ||
export interface Sinks { | ||
[driverName: string]: FantasyObservable; | ||
} | ||
export interface XStreamSinks extends Sinks { | ||
[driverName: string]: Stream<any>; | ||
@@ -14,3 +32,3 @@ } | ||
export interface DriverFunction { | ||
(stream: Stream<any>, driverName: string): any; | ||
(stream: FantasyObservable, driverName: string): any; | ||
} | ||
@@ -37,4 +55,4 @@ | ||
function makeSinkProxies(drivers: DriversDefinition): Sinks { | ||
const sinkProxies: Sinks = {}; | ||
function makeSinkProxies(drivers: DriversDefinition): XStreamSinks { | ||
const sinkProxies: XStreamSinks = {}; | ||
for (let name in drivers) { | ||
@@ -48,3 +66,3 @@ if (drivers.hasOwnProperty(name)) { | ||
function callDrivers(drivers: DriversDefinition, sinkProxies: Sinks): any { | ||
function callDrivers(drivers: DriversDefinition, sinkProxies: XStreamSinks): any { | ||
const sources = {}; | ||
@@ -81,3 +99,3 @@ for (let name in drivers) { | ||
function replicateMany(sinks: Sinks, sinkProxies: Sinks): DisposeFunction { | ||
function replicateMany(sinks: Sinks, sinkProxies: XStreamSinks): DisposeFunction { | ||
const sinkNames = Object.keys(sinks).filter(name => !!sinkProxies[name]); | ||
@@ -145,3 +163,3 @@ | ||
* import {setup} from '@cycle/run'; | ||
* const {sources, sinks, run} = Cycle(main, drivers); | ||
* const {sources, sinks, run} = setup(main, drivers); | ||
* // ... | ||
@@ -178,4 +196,4 @@ * const dispose = run(); // Executes the application | ||
const sinkProxies: Sinks = makeSinkProxies(drivers as DriversDefinition); | ||
const sources: So = callDrivers(drivers as DriversDefinition, sinkProxies); | ||
const sinkProxies = makeSinkProxies(drivers); | ||
const sources: So = callDrivers(drivers, sinkProxies); | ||
const sinks: Si = main(sources); | ||
@@ -182,0 +200,0 @@ if (typeof window !== 'undefined') { |
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
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
47899
928