Open aravantv opened 8 years ago
Mmmh I see that collection
needs xstream
anyways, so I could even make the types dependent on Stream
.
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.
Sure, I will work it properly and do a pull request. Do you confirm that a dependency on xstream is no problem?
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:
Sure, I will work it properly and do a pull request. Do you confirm that a dependency on xstream is no problem?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cyclejs/collection/issues/26#issuecomment-255871424, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYUHaRKiBJZDPd_74CtrCgsbgHZp89uks5q3SLlgaJpZM4KeEz7 .
Ok I understand you can use any other library. But in any case you still need to import xstream don't you?
I see what you're saying now, yes, you're right, you could pull in Stream
from xstream
.
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 :-)
Have a lovely holiday! :smile_cat:
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. :smile:
Hi, for info, I'm back from vacation and working on it! :-)
Great to hear. I've been brushing up on my TypeScript recently, looking forward to reviewing :smile:
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
...?
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 :)
Hi,
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.
The following one could be a basis I believe: