These are chat archives for pozadi/kefir

15th
Feb 2015
Roman Pominov
@rpominov
Feb 15 2015 14:54
@shamansir I've added the repeat method to the core http://pozadi.github.io/kefir/#repeat available in v1.1.0
Ulric Wilfred
@shamansir
Feb 15 2015 15:24
@pozadi it’s great, thank you!
@pozadi and it’s exactly what I've needed, the iteration number and a condition for exit, just great! :)
Roman Pominov
@rpominov
Feb 15 2015 15:36
@shamansir nice)
Juha Paananen
@raimohanska
Feb 15 2015 16:33
I like this part "So just be careful when using repeat, it's a little dangerous but still a great method."
All in all, good work. I'll rename Bacon.fromStreamGenerator to Bacon.repeat and add the index param for consistency with Kefir.
Roman Pominov
@rpominov
Feb 15 2015 16:52
@raimohanska Great! Consistency FTW!
After writing all warnings I was like "ah, what a terrible method, have to write something nice at the end" :)
Thanks for the inspiration on the documentation :)
Roman Pominov
@rpominov
Feb 15 2015 17:03
No problem, I have a whole library based on Bacon)
Juha Paananen
@raimohanska
Feb 15 2015 17:08
... which I have always taken as a complement.
Maybe one day you'll render Bacon.js wholly obsolete and I can retire and have Pina Coladas on my (huge) yacht
Roman Pominov
@rpominov
Feb 15 2015 17:10
heh, who knows)
Juha Paananen
@raimohanska
Feb 15 2015 17:11
Which I bought with the Bacon.js Enterprise Editition license monies
Roman Pominov
@rpominov
Feb 15 2015 17:12
nah, enterprise guys use RxJS
Juha Paananen
@raimohanska
Feb 15 2015 17:53
:)
Rodolfo Hansen
@kryptt
Feb 15 2015 20:38
So @raimohanska, why would I choose Kevin over bacon?
*Kefir
Petr Myazin
@pqr
Feb 15 2015 21:37
@kryptt depends on taste. If you are vegan then you would prefer kefir!
@pozadi need your advice again! I am stil playing with my pricing table application. Now I want to introduce "Add row" button
I've created a new stream var addRowClick = $('#addrow').asKefirStream('click', function(e) { return 'add new row, please' });
and merged it with previous (table keyup) stream: changes = Kefir.merge([tableChanges, addRowClick]);
I manage to push new row into property-state within changes.scan - here I am fine
but how do I manage to add a new row into DOM? where and how should I make this side effect?
Petr Myazin
@pqr
Feb 15 2015 21:44
could you please look into my jsfiddle ( http://jsfiddle.net/pqr/7ddybos9/1/ )? I put additional QUESTION comment there in critical place
Petr Myazin
@pqr
Feb 15 2015 22:05
@pozadi oh, looks like I found a solution for adding rows into DOM: http://jsfiddle.net/pqr/7ddybos9/2/ - could you review it?
var rowsCountIncreasesByOne = curStateWithoutDuplicates.diff(function(prev, next) {
    if (next.length - prev.length === 1) {
        //return new row number for dom manipulation
        return prev.length;
    }

    return null;
})
.changes()
.filter(function(newRowNum) {return newRowNum !== null;});