These are chat archives for pozadi/kefir

27th
Sep 2015
Ulric Wilfred
@shamansir
Sep 27 2015 16:43
Hi again. @rpominov trying to update to v3.0.0, but it misses Kefir.sampledBy() is that intended?
Ulric Wilfred
@shamansir
Sep 27 2015 16:47
@xgrommx Thanks a lot, I’ve searched among issues and forgot this document exists!
Denis Stoyanov
@xgrommx
Sep 27 2015 16:48
@shamansir no problem =) Also you can take a look at changelog
Ulric Wilfred
@shamansir
Sep 27 2015 16:52
Also, first I though to stick with latest minor version of v.2, but I used to download it from http://rpominov.github.io/kefir/dist/kefir.min.js even for testing purposes (I use no browserify or webpack for the moment). Do you plan to host latest minor versions there? Or is it safer to solve it with package.json?
Ulric Wilfred
@shamansir
Sep 27 2015 17:10
ok, seems renaming stuff is not enough, some changes in new version seem to break a lot in my case.
Ulric Wilfred
@shamansir
Sep 27 2015 17:19
uh, no, that’s just indices changed in handlers after changing sampledBy to combine. indices are evil ;).
Roman Pominov
@rpominov
Sep 27 2015 18:18

@shamansir

Do you plan to host latest minor versions there?

You probably can use https://www.jsdelivr.com/?query=kefir

Ulric Wilfred
@shamansir
Sep 27 2015 18:18
@rpominov Oh, that’s nice! Thanks!
Btw my update passed well :v:
Roman Pominov
@rpominov
Sep 27 2015 18:19
Cool, all changes are listed in https://github.com/rpominov/kefir/blob/master/changelog.md#300-26092015 and include links to issues where you can find migration guides.
(In case you run into other problems)
Zaim Bakar
@zaim
Sep 27 2015 19:04
Hello. Question about errors: are errors thrown in any of the stream modifier functions like map, filter, etc. re-emitted as error values? If not, is it a good idea to do so and how?
Roman Pominov
@rpominov
Sep 27 2015 19:42
Hey. No, we don't currently have any try..catch blocks in Kefir. I think app must crash hard on exceptions, and any attempt to handle exceptions somehow in async code only make debugging harder. But this is only my opinion, and I know others find it useful to transform exceptions into error-events, and this is how it works in RxJS and Most.js. You may want to try this other libraries.
Also if you need to catch exceptions only in some cases, you can do it using flatMap:
foo.flatMap(x => {
  try {
    return Kefir.constant(unsafeFunction(x))
  } catch(e) {
    return Kefir.constantError(e)
  }
})
Zaim Bakar
@zaim
Sep 27 2015 19:48
Cool. That's pretty much what I came up with just now :smile:
Roman Pominov
@rpominov
Sep 27 2015 19:48
:+1:
flatMap basically is a swiss knife of transforming streams, it can do anything :)