These are chat archives for pozadi/kefir

26th
Mar 2015
Petr Myazin
@pqr
Mar 26 2015 09:14
Hi all! I am looking an example or production-ready-lib for flux+kefir. The only thing I found on github: https://github.com/Willmo36/FluxKefir - but it looks like first draft (the only commit there). Have you seen another examples/libs for flux+kefir?
Sergey Lapin
@lapanoid
Mar 26 2015 09:16
@pqr I am working on the same thing now) I started to port this from bacon https://github.com/niklasvh/react-bacon-flux-poc
It is the best approach to frp and flux together that I found out so far
Nikita Dudnik
@Nek
Mar 26 2015 10:01
Haven't seen the talk yet but I completely agree on "no abstraction > wrong abstraction"
Petr Myazin
@pqr
Mar 26 2015 11:02
@lapanoid, I was thinking about the same - port one of bacon implementations. Looking forward for your repo!
Petr Myazin
@pqr
Mar 26 2015 11:40
need advice: I have an emitter (var source = Kefir.emitter()) and then several streams based on it, e.g. var result = source.filter(...).map(...). Then I found a business case in my business logic: sometimes I want manully push a value into result stream. But result does not have .emit() method. How do I put event into result stream directelly?
what I do now: http://jsfiddle.net/pqr/3e0pexfb/ - is it a good approach?
Sergey Lapin
@lapanoid
Mar 26 2015 11:44
I guess 'directly' is just a mutation - not a good idea. You can combine result with another stream that would represent your push business logic.
Petr Myazin
@pqr
Mar 26 2015 11:49
Yes, I did the same: created antoher stream for manual pushes from business logic and then merged var resultWithPushes = Kefir.merge([result, anotherEmiiterForPushes])
ok, so I am in the right direction of FRP, thank you!
Sergey Lapin
@lapanoid
Mar 26 2015 13:59
Petr Myazin
@pqr
Mar 26 2015 16:45
great! watching yor repository now
Petr Myazin
@pqr
Mar 26 2015 20:02
@lapanoid, have you tried React 0.13 with ES6 class syntax? I am already using it (I like es6 and use it in all my projects, not only React). So the problem here is that you can't use mixins with React components written as es6 classes (there is a blog post about it on react site), but Flux implementation based on Bacon and your Kefir port use mixins. What do you think: is it possible to avoid mixins?
Sergey Lapin
@lapanoid
Mar 26 2015 20:04
I don't know, could you give a link on this post?
Petr Myazin
@pqr
Mar 26 2015 20:05
Also Original Flux examples from FB do not use mixins. I know, there are many boilerplate with their stores aka EventEmitter, but I feel it's not so bad to copy/paste a little bit boilerplate
Sergey Lapin
@lapanoid
Mar 26 2015 20:07
Okey, I'll think about mixins
Sergey Lapin
@lapanoid
Mar 26 2015 20:13
@pqr I am still on es5 with coffeescript and in closest future I don't want to switch my stuff to es6 , so If you want you can port this on es6 yourself.
Jared Forsyth
@jaredly
Mar 26 2015 20:20
@lapanoid @pqr from the react team, the new way of doing mixin-like things is with Higher-Order Components
Sergey Lapin
@lapanoid
Mar 26 2015 20:25
@jaredly cool, thanks! I guess replacing mixins by that is easy