## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### Activity
• Nov 09 23:05
CarlLeth commented #310
• Nov 09 23:04
CarlLeth commented #310
• Nov 09 23:03
CarlLeth commented #310
• Nov 09 18:52
matthewjamesadam commented #310
• Nov 09 08:45
staltz commented #310
• Nov 09 08:45
staltz commented #310
• Nov 09 08:44
staltz commented #310
• Nov 09 04:53
matthewjamesadam commented #310
• Jul 14 15:56
Avaq edited #337
• Jul 14 15:49
Avaq synchronize #337
• Jul 14 15:39
Avaq edited #337
• Jul 14 15:38
Avaq edited #337
• Jul 14 15:38
Avaq edited #337
• Jul 14 15:38
Avaq opened #337
• Jun 22 05:52
dependabot[bot] labeled #336
• Jun 22 05:52
dependabot[bot] opened #336
• Jun 22 05:52

dependabot[bot] on npm_and_yarn

chore(deps): bump shell-quote f… (compare)

• May 02 16:35
PEZO19 commented #46
• May 02 16:34
PEZO19 commented #46
• May 02 16:34
PEZO19 commented #46
Вячеслав Истомин
@shofel
@FeliciousX, thanks for the reply! All you have written does make sense :D Let me repost this question to the cyclejs gitter channel.
fiatjaf
@fiatjaf
I don't understand the difference between addListener and subscribe
what is it?
if a stream has only listeners and no subscribers it will not run, is that it?
fiatjaf
@fiatjaf

a different question:
if I do something like

let count$= xs.periodic(1000) let count2$ = count$.map(c => c * 2) let count3$ = count$.map(c => c * 3) let countAndCount2AndCount3$ = count$.compose(sampleCombine(count2$, count3$)) can I be sure countAndCount2AndCount3$ will be -[1,2,3]---[2,4,6]---[3,6,9]-?
or does it depend on race conditions and maybe it will be -[1,2,3]---[2,2,3]---[3,4,9]-?

André Staltz
@staltz
@fiatjaf addListener and subscribe are basically the same, but subscribe returns a subscription
basically we we addListener, but subscribe is there just to have interop with ES Observable
the second question: I wouldn't model the problem like that because it's a diamond shaped situation and you might hit glitches
read my blog post about glitches in rxjs
fiatjaf
@fiatjaf
oh, those are the famous glitches! I'm reading it.
André Staltz
@staltz
yep
in short, we don't try to guarantee those conditions you mentioned. maybe it will work like you expected, but glitch avoidance is actually super expensive on performance to guarantee always
fiatjaf
@fiatjaf
so the recommendation is to never do diamonds?
just map the values directly instead of creating different streams and combining them together later?
André Staltz
@staltz
yes
diamonds are overrated :D
fiatjaf
@fiatjaf
:P
Steve Lee
@SteveALee
'Diamonds are forever' - sometimes! :(
fiatjaf
@fiatjaf
just found a diamond: http://i.imgur.com/YKiSZKM.png
André Staltz
@staltz
yep and Elm nowadays doesn't have signals : )
Samuel DeSota
@mrapogee

@staltz Has anybody created this? Proxies with imitate() kinda suck, I was thinking they could be replaced with a lazy stream function, this:

const proxy$= xs.create() const child = Child({value: proxy$})
proxy$.imitate(child.value) becomes: const childValue$ = lazy(() => child.value)
const child = Child({value: childValue$}) They lazy() function returns a xstream that doesn't call the () => child.value until it is subscribed to. Churchill Lee @FeliciousX why do they suck? @mrapogee André Staltz @staltz @mrapogee that's smart, and would work. imitate is just a bit more general because the streams don't need to be all in the same variable scope/closure Michal Vanko @michalvankodev How can I describe a type of Stream that will never emit any value, but it can emit error ? André Staltz @staltz Stream<any> errors are untyped throughout the entire JavaScript and TypeScript, actually (note that try/catch is never typed) Michal Vanko @michalvankodev Thanks man :) I've noticed that xs.never() -> Stream<any> André Staltz @staltz :+1: jfcha @jfcha Is there a good way to access the stored value in MemoryStream? I'm guessing I could use a listener to update an environment variable, but that seems pretty messy. adz5a @adz5a as the memory stream will emit its last emitted value, you could stream.take(1).addListener to retrieve the stored value jfcha @jfcha I was hoping to avoid going through a listener, but good to know that'll work. Thanks. I suppose getting values outside of the stream isn't really ideal behavior so having to pay a tax on it makes some sense. adz5a @adz5a i don't think there is another way to "unwrap" values from a stream apart from a listener, what is your use case, maybe i can help :) jfcha @jfcha It's a bit complicated and I have a work around. I was just hoping for a lazy answer :) . Thanks for the offer though! If I come up with a succinct case I'll ask again. adz5a @adz5a hello, I have a case a problem, that i don't quite understand, I made gist of it i'm trying to understand why my get function is getting increasedly more called it's not a bug I guess ( i made a similar gist with most.js and I have the same behaviour ) : I receive only "1--lol--lol" the expected number of times, but my get function is being called a lot : once the first time, two times the second and so on... André Staltz @staltz Hi @adz5a. There are 3 nested flattens, that looks very weird I suspect, depending on what you want to achieve, you can simplify this a lot adz5a @adz5a Probably, the idea is this : i have a stream with a low frequency : props$. When it emits I generate a second stream which models input from the user, and at each new value from the second one, i make an asynchronous operation and merge back the results
( I am using the componentFromStream operator from recompose )
I will try and simplify it, I think I don't understand fully what i am trying to achieve here...
Jules Sam. Randolph
@jsamr
Hi ! Really enjoying reactive programming thanks to cycle + xtream. I can't find the zip operator ; has anyone written a custom extra ?
Michal Vanko
@michalvankodev
Jules Sam. Randolph
@jsamr
@michalvankodev thanks, but unfortunately it's different, see those marbles : http://rxmarbles.com/#zip http://rxmarbles.com/#concat
Churchill Lee
@FeliciousX
@sveinburne u might want to read up on this https://staltz.com/rx-glitches-arent-actually-a-problem.html