Open justinbmeyer opened 7 years ago
I think we can accomplish this easier by making can-stream & can-define-stream decoupled from RxJS / Kefir, and then loading in either interchangeably, maybe via can-namespace
.
"meta": {
"can-stream": {
"deps": [
"can-stream-kefir"
]
}
}
"meta": {
"can-stream": {
"deps": [
"can-stream-rxjs"
]
}
}
This then would have the benefit that anything can-stream-kefir
compatible would also be can-stream-rxjs
compatible. Authors could write using can-stream-kefir
if they don't need the full API & users then could transparently swap in can-stream-rxjs
on an as needed basis.
They can't really be used interchangeably because their streams have different APIs.
There needs to be a specific stream integration for each. Can explain at Friday's meeting.
Sent from my iPhone
On Dec 29, 2016, at 6:26 PM, Thomas Sieverding notifications@github.com wrote:
I think we can accomplish this easier by making can-stream & can-define-stream decoupled from RxJS / Kefir, and then loading in either interchangeably, maybe via can-namespace.
"meta": { "can-stream": { "deps": [ "can-stream-kefir" ] } }
"meta": { "can-stream": { "deps": [ "can-stream-rxjs" ] } } This then would have the benefit that anything can-stream-kefir compatible would also be can-stream-rxjs compatible. Authors could write using can-stream-kefir if they don't need the full API & users then could transparently swap in can-stream-rxjson an as needed basis.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
How far off are their API's? RxJS has a lot more functionality for sure, but the overlap looked considerable. Drop in substitution would be really awesome if possible
Steps
can-stream
tocan-stream-kefir
.canStreamKefir.toCompute( func(setStream):stream )
that returns a compute that when set, fires an event on thesetStream
... and the value of the compute is the last value of the returned stream. needed so can-define-stream wouldn't need Kefir.can-define-stream-kefir
for easier mixins like:can-define-stream
to a helper that takes a CanJS-ified stream library and provides the mixin like:Benefits