Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 07 20:08

    dependabot[bot] on npm_and_yarn

    (compare)

  • May 07 20:08

    staltz on master

    chore(deps): bump ini from 1.3.… (compare)

  • May 07 20:08
    staltz closed #322
  • May 07 19:58

    dependabot[bot] on npm_and_yarn

    (compare)

  • May 07 19:58

    staltz on master

    chore(deps): bump hosted-git-in… (compare)

  • May 07 19:58
    staltz closed #321
  • May 07 19:47

    dependabot[bot] on npm_and_yarn

    (compare)

  • May 07 19:47
    dependabot[bot] closed #318
  • May 07 19:47
    dependabot[bot] commented #318
  • May 07 19:47
    dependabot[bot] labeled #322
  • May 07 19:47
    dependabot[bot] opened #322
  • May 07 19:47

    dependabot[bot] on npm_and_yarn

    chore(deps): bump ini from 1.3.… (compare)

  • May 07 19:47
    dependabot[bot] edited #318
  • May 07 19:46
    dependabot[bot] labeled #321
  • May 07 19:46
    dependabot[bot] opened #321
  • May 07 19:46

    dependabot[bot] on npm_and_yarn

    chore(deps): bump hosted-git-in… (compare)

  • May 07 19:46
    dependabot[bot] edited #318
  • May 07 19:45

    staltz on npm_and_yarn

    (compare)

  • May 07 19:45

    staltz on master

    chore(deps): bump handlebars fr… (compare)

  • May 07 19:45
    staltz closed #320
André Staltz
@staltz
I think we already have an operator for that: pairwise
it's an extra operator
Marco Toniut
@marcotoniut

@marcotoniut
Hey everyone, I finally managed to pinpoint a bug my program had to this localized piece of code

test('combine', t => {
    const s$ = Stream.of(Stream.of(1), Stream.of(2), Stream.of(3))
        .map(x => x.remember())
        .fold((acc: Stream<number>[], x: Stream<number>) => [...acc, x], [] as Stream<number>[]).debug('collection')
        .map(ss => combine(...ss)).flatten().debug('combined');
    // return s$.take(1).map(x => t.deepEqual(x, []));
    // return s$.last().map(x => t.deepEqual(x, [1, 2, 3]));
    return combine(s$.take(1), s$.last()).map(([x, y]) => {
        t.deepEqual(x, []);
        t.deepEqual(y, [1, 2, 3]);
    });
});

From what I can gather, the problem is that after the s$.take(1) stream is travelled, the source streams in combine aren't re-triggering the events for s$.last() to complete
Therefore, the combined s$.take(1) and s$.last() never finishes
Is there a way to prevent this from happening? I thought remember was supposed to re-trigger the event when a new stream was hooked to it

Вячеслав Истомин
@shofel
@staltz, yeah it is! Don't know how could I overlook this))
Alex
@whitecolor
@staltz Say I have: const source = periodic(100); const sA = source.map(x => x*10); const sB = source.map(x => x*20) Is it possible to check if both sA and sB "come" from the same source stream? (maybe using some "private" props)
André Staltz
@staltz
Yes there is
The cycle devtools do that
Through some underscore prefixed properties like _ins
Alex
@whitecolor
So I believe I should recursively traverse s._prod.ins to get to the common source
André Staltz
@staltz
Yes : )
Вячеслав Истомин
@shofel

Have a nice day!

My collegue and I trying to run our cycle.js application on Chrome 49. This is the newest version available for Windows XP.
Windows XP is, of course, a requirement by very old and very big national company :)))

We use babel preset env chrome >= 49, and babel-polyfill.
And it fails at some point somewhere inside Stream with a cryptic error "Illegal invocation."

@staltz Is there any chances to run xstream on Chrome 49,
or there are some known obstacles?

Вячеслав Истомин
@shofel

It appeared, the Yandex browser, which is based on Chromium, had been maintained for longer time than Chrome. And for some reason it works better with our app.

The further, the less it's about the xstream library. But I still curious if there is some feature of browser, which xstream uses, and which some old browsers lack and can not be polyfilled.

Nick Johnstone
@Widdershin
@shofel any chance you could make a minimal reproducer? not too much to go on here
Вячеслав Истомин
@shofel
@Widdershin thanks for consideration! We've decided to be contained with Yandex browser. I believe the issue relates only to some ancient browsers and hence it doesn't worth to be investigated.
Nick Johnstone
@Widdershin
👍
Tom Cumming
@tomcumming
when is xstream gonna be patched for newish typescript ?
Nick Johnstone
@Widdershin
@tomcumming have you considered making a pull request? (assuming there's not already one)
Tom Cumming
@tomcumming
there is one
i think it needs a major version change though
Ionut Achim
@monojack
can you access the value from a MemoryStream without adding a listener?
André Staltz
@staltz
No
Ionut Achim
@monojack
thanks
Carlos Precioso
@cprecioso
Hi! I was wondering if there's a conventional way of creating an xstream from a node.js ReadableStream?
Nevermind, just found the fromEvent documentation 😅
Juan J. Jimenez-Anca
@cortopy
not sure if there are any reason/bucklescript coders in the room, but just in case https://www.npmjs.com/package/@j3a/bs-xstream
Goal is to use cycle with reasonml. I've started with the bindings for xstream
André Staltz
@staltz
Nice!
Marton Sari
@sarimarton
Hi, I've come across a problem and I'd like to get some help/advice. Currently I have a workaround, but I find it really cumbersome. I want to implement a back navigation intention stream which contains the back url and passes it to the navigation sink. This stream should be derived from a click$ (a click on a "back" button) stream, but that I have no access to the URL this way. I can combine it with a backUrl$ stream, which contains the updated url, but then the problem is that because of the history navigation, backUrl$ gets recalculated and emits its value again, which starts an infinite loop.
So far I solved the problem with a merge/fold, which contains the url, and duck type checks if the latest event on the stream is a click:
  const backNavigationHeaderClick$ =
    xs.merge(homePageClick$, backUrl$)
      .fold(
        (acc, clickOrUrl) => ({
          url: typeof clickOrUrl === 'string' ? clickOrUrl : acc.url,
          isClick: typeof clickOrUrl !== 'string'
        }),
        {}
      )
      .filter(({ isClick }) => isClick)
      .map(({ url }) => url)
But this is way too complicated, and I suppose there's a simpler solution
Géraud Henrion
@fuunnx
seungju
@seungjuchae
What`s the equivalent creation operator of fromEvent (rxjs) in xstream?
oh nevermind. found it in extra operators
Alexander Blüm
@jopek
hey, is there a way of repeating a finished stream like the RxJS's repeat operator?
André Staltz
@staltz
Not in core and probably also not on npm
But you could make use of replaceError for this purpose
Nah, I don't think we can use replaceError for that
Maybe it's worth building xstream-repeat
Sylvain Desvé
@sylvaindesve
Hi there !
I have an API with paginated resources
I get an "x-next-page" header with the next page index if there are more resources to get
I want to build a stream which emit all pages
How would you do that with xstream ?
Géraud Henrion
@fuunnx
Hi ! Recursivity is the way to go :)
Sylvain Desvé
@sylvaindesve
Thanks @fuunnx . I managed to do it using rxjs and its expand operator.