refract-xstream
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -148,3 +148,12 @@ import xs from 'xstream'; | ||
pushEvent: pushEvent, | ||
useEvent: function (eventName) { return [fromEvent(eventName), pushEvent(eventName)]; } | ||
useEvent: function (eventName, seedValue) { | ||
var events$ = fromEvent(eventName); | ||
var pushEventValue = pushEvent(eventName); | ||
return [ | ||
seedValue === undefined | ||
? events$ | ||
: events$.startWith(seedValue), | ||
pushEventValue | ||
]; | ||
} | ||
}; | ||
@@ -151,0 +160,0 @@ }; |
11
index.js
@@ -154,3 +154,12 @@ 'use strict'; | ||
pushEvent: pushEvent, | ||
useEvent: function (eventName) { return [fromEvent(eventName), pushEvent(eventName)]; } | ||
useEvent: function (eventName, seedValue) { | ||
var events$ = fromEvent(eventName); | ||
var pushEventValue = pushEvent(eventName); | ||
return [ | ||
seedValue === undefined | ||
? events$ | ||
: events$.startWith(seedValue), | ||
pushEventValue | ||
]; | ||
} | ||
}; | ||
@@ -157,0 +166,0 @@ }; |
{ | ||
"name": "refract-xstream", | ||
"description": "Refract bindings for React with xstream: harness the power of reactive programming to supercharge your components!", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "jsnext:main": "index.es.js", |
@@ -16,3 +16,6 @@ import { Stream, Listener, Subscription } from 'xstream' | ||
pushEvent: PushEvent | ||
useEvent: <T>(eventName: string) => [Stream<T>, (val: T) => any] | ||
useEvent: <T>( | ||
eventName: string, | ||
seedValue?: T | ||
) => [Stream<T>, (val: T) => any] | ||
} | ||
@@ -31,3 +34,3 @@ export declare type Aperture<P, E, C = any> = ( | ||
dataObservable: any, | ||
pushEvent: any | ||
pushEvent: PushEvent | ||
) => ObservableComponent |
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
42518
901