arqex / freezer

A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.
MIT License
1.28k stars 56 forks source link

Subscribe after setting triggers #85

Closed kuraga closed 7 years ago

kuraga commented 8 years ago

Failing test, see also #67:

it( "Subscribe after update shouldn't trigger", function( done ){
    var listener = data.b.getListener(),
        count = 0
    ;

    data.b.set( {c: 3} );

    listener.on( 'update', function( data ){
        count++;
    });

    setTimeout(function () {
        assert.equal( count, 0 );
    }, 250);
});
arqex commented 7 years ago

Hey @kuraga

How are things doing, I am updating freezer a bit and closing tickets.

Thanks for your collaboration, always appreciated.

kuraga commented 7 years ago

Well now I think that it won't wail if I wait a tick before setting trigger...