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

Add failing test: subscribe after set triggers callback #67

Closed kuraga closed 8 years ago

kuraga commented 8 years ago

I think that set of triggers is determined before calling callbacks (in next animation frame) but not at calling .set.

kuraga commented 8 years ago

@arqex did you classify this issue?

arqex commented 8 years ago

Hi @kuraga

This issue is still open and I would like to fix it. I have tried to do so a time ago, but I had no luck. I will leave it open to remind me.

Cheers

arqex commented 8 years ago

Hey @kuraga

How are things doing, still using freezer? This PR is difficult to solve, I haven't found a simple way of make that test pass.

Basically, we would need to not add the callback immediately on the on method and wait for the next tick to add it. It generates a lot of complexity and I don't know if the issue worths the effort.

I'll close the PR, and come back to it if anybody complains about the same issue.

Cheers!

kuraga commented 8 years ago

@arqex my library still uses Freezer but I don't use my library (cause left web programming for some time) :smile: .

But I don't agree with you about closing this issue. I think it's more important than some other opened issues. So I'll open an issue (instead off pull request). Feel free to close but I don't agree :smile:

kuraga commented 8 years ago

@arqex P.S. Is getEventHub just getEventListener without store access? Or are there some other differences?