refract-callbag
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -101,2 +101,3 @@ import $$observable from 'symbol-observable'; | ||
var filter = require('callbag-filter'); | ||
var startWith = require('callbag-start-with'); | ||
var subscribeToSink = function (sink, next, error) { | ||
@@ -138,3 +139,12 @@ return toObs(sink).subscribe({ | ||
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$.pipe(startWith(seedValue)), | ||
pushEventValue | ||
]; | ||
} | ||
}; | ||
@@ -141,0 +151,0 @@ }; |
12
index.js
@@ -107,2 +107,3 @@ 'use strict'; | ||
var filter = require('callbag-filter'); | ||
var startWith = require('callbag-start-with'); | ||
var subscribeToSink = function (sink, next, error) { | ||
@@ -144,3 +145,12 @@ return toObs(sink).subscribe({ | ||
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$.pipe(startWith(seedValue)), | ||
pushEventValue | ||
]; | ||
} | ||
}; | ||
@@ -147,0 +157,0 @@ }; |
{ | ||
"name": "refract-callbag", | ||
"description": "Refract bindings for React with Callbag: harness the power of reactive programming to supercharge your components!", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"main": "index.js", | ||
@@ -21,2 +21,3 @@ "jsnext:main": "index.es.js", | ||
"callbag-pipe": "~1.1.1", | ||
"callbag-start-with": "~3.1.0", | ||
"callbag-to-obs": "~1.0.0", | ||
@@ -23,0 +24,0 @@ "symbol-observable": "~1.2.0" |
@@ -37,3 +37,3 @@ import { Callbag, Source, Sink } from 'callbag' | ||
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
42858
885
10
+ Addedcallbag-start-with@~3.1.0
+ Addedcallbag-start-with@3.1.0(transitive)