Comparing version 3.1.0 to 3.2.0
16
index.js
'use strict'; | ||
function kefirCast(Kefir, input) { | ||
if (input && input.subscribe && input.subscribeOnNext) { // RxJS | ||
if (input && input.subscribe && input.subscribeOnNext) { // RxJS <= 4 | ||
return Kefir.stream(function(emitter) { | ||
@@ -18,2 +18,16 @@ var subscription = input.subscribe(function onNext(value) { | ||
}); | ||
} else if (input && input.subscribe && input.onErrorResumeNext) { // RxJS 5 | ||
return Kefir.stream(function(emitter) { | ||
var subscription = input.subscribe(function onNext(value) { | ||
emitter.emit(value); | ||
}, function onError(err) { | ||
emitter.error(err); | ||
emitter.end(); | ||
}, function onCompleted() { | ||
emitter.end(); | ||
}); | ||
return function() { | ||
subscription.unsubscribe(); | ||
}; | ||
}); | ||
} else if (input && input.onAny && input.offAny) { // Kefir | ||
@@ -20,0 +34,0 @@ return Kefir.stream(function(emitter) { |
The MIT License (MIT) | ||
Copyright (c) 2015 Rewardly, Inc. | ||
Copyright (c) 2017 Rewardly, Inc. | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "kefir-cast", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "Convert various types of streams to Kefir streams.", | ||
@@ -37,10 +37,11 @@ "main": "index.js", | ||
"devDependencies": { | ||
"babel-eslint": "^6.1.2", | ||
"@reactivex/rxjs": "^5.5.2", | ||
"babel-eslint": "^8.0.2", | ||
"baconjs": "^0.7.41", | ||
"eslint": "^3.4.0", | ||
"flow-bin": "^0.31.1", | ||
"eslint": "^4.11.0", | ||
"flow-bin": "^0.59.0", | ||
"kefir": "^3.0.0", | ||
"kefir-bus": "^2.0.0", | ||
"lodash": "^4.15.0", | ||
"mocha": "^3.0.2", | ||
"mocha": "^4.0.1", | ||
"rx": "^4.0.8" | ||
@@ -47,0 +48,0 @@ }, |
@@ -11,3 +11,3 @@ # KefirCast | ||
* Supports converting RxJS Observables into Kefir streams. | ||
* Supports converting RxJS (v2-v5) Observables into Kefir streams. | ||
* Supports converting Bacon.js streams into Kefir streams. | ||
@@ -14,0 +14,0 @@ * Supports converting a Kefir stream created by one instance of the Kefir |
Sorry, the diff of this file is not supported yet
8030
102
10
8