You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
would be great to have a typescript definition file.
I think it's hard to make it perfect due to the fact that cyclejs tries to be stream-library independent (entailing no one-type for streams), but at least a pragmatic typing which would just prevent having "unknown module" errors when using collections.
Sorry was not clear in the first place. Great I'll work on it, but don't expect a pull request before a month or so - going for three weeks on vacation :-)
Uhhh, I'm myself not an expert... Fearing your reviewing! ;-)
Anyways it's tougher than I thought. I will do it XStream-specific, at least for a start.
On my way I have a collection-specific question: which sort of data is actually carried by a stream issued from Collection? It actually looks like the stream of array of items. But if it was just this, we would not need pluck...?
You could write an equivalent to pluck like collection$.map(items => xs.combine(...items.map(item => item.property)).flatten() but that doesn't quite work properly if I recall. I think because you need to remember the property stream, but just adding . remember() there isn't good enough because it gets recreated when the collection changes.
Pluck remembers sink streams across collection changes.
Tell you the truth, there's a whole bunch of things that coukd probably be simplified inside of collection, so please keep asking questions as they come up :)
Activity
aravantv commentedon Oct 24, 2016
Mmmh I see that
collectionneedsxstreamanyways, so I could even make the types dependent onStream.Widdershin commentedon Oct 24, 2016
I welcome a definition, are you interested in doing a pull request?
A full TypeScript rewrite has been on the cards for a while. If someone is keen to get stuck into that I would be happy to support them.
aravantv commentedon Oct 24, 2016
Sure, I will work it properly and do a pull request.
Do you confirm that a dependency on xstream is no problem?
Widdershin commentedon Oct 25, 2016
I'm not sure, I'm no TypeScript expert. It's worth noting that collection
is stream library agnostic, via adapters. So it's not just xstream only.
On 25/10/2016 10:28 AM, "Vincent Aravantinos" notifications@github.com
wrote:
aravantv commentedon Oct 25, 2016
Ok I understand you can use any other library. But in any case you still need to import xstream don't you?
Widdershin commentedon Oct 25, 2016
I see what you're saying now, yes, you're right, you could pull in
Streamfromxstream.aravantv commentedon Oct 25, 2016
Sorry was not clear in the first place. Great I'll work on it, but don't expect a pull request before a month or so - going for three weeks on vacation :-)
Widdershin commentedon Oct 25, 2016
Have a lovely holiday! 😸
I'll leave this issue unassigned for now, and if you feel like working on it when you get back, just comment and I'll assign it to you.
I'll also open an issue for a typescript rewrite. 😄
aravantv commentedon Dec 3, 2016
Hi, for info, I'm back from vacation and working on it! :-)
Widdershin commentedon Dec 3, 2016
Great to hear. I've been brushing up on my TypeScript recently, looking forward to reviewing 😄
aravantv commentedon Dec 3, 2016
Uhhh, I'm myself not an expert... Fearing your reviewing! ;-)
Anyways it's tougher than I thought. I will do it XStream-specific, at least for a start.
On my way I have a collection-specific question: which sort of data is actually carried by a stream issued from
Collection? It actually looks like the stream of array of items. But if it was just this, we would not needpluck...?Widdershin commentedon Dec 3, 2016
Correct, it is a stream of arrays of item sinks.
You could write an equivalent to pluck like
collection$.map(items => xs.combine(...items.map(item => item.property)).flatten()but that doesn't quite work properly if I recall. I think because you need to remember the property stream, but just adding . remember() there isn't good enough because it gets recreated when the collection changes.Pluck remembers sink streams across collection changes.
Tell you the truth, there's a whole bunch of things that coukd probably be simplified inside of collection, so please keep asking questions as they come up :)