Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream updated after conditionaly halt its parent #1714

Closed
gaspoute opened this issue Mar 15, 2017 · 4 comments
Closed

Stream updated after conditionaly halt its parent #1714

gaspoute opened this issue Mar 15, 2017 · 4 comments
Labels
Type: Bug For bugs and any other unexpected breakage

Comments

@gaspoute
Copy link

Hello,

I encounter an unexpected behavior when I use Mithril streams, here is the JSFiddle. I expect that count equals zero when halt is true. I also try to replace the map with a combine but the result is the same.

I also write a test, that will become a pull request if it's really an issue or a misunderstanding.

Gaspar.

@dead-claudia
Copy link
Member

I'd say that's definitely odd...

@dead-claudia dead-claudia added the Type: Bug For bugs and any other unexpected breakage label Mar 17, 2017
@dead-claudia
Copy link
Member

I'd expect the same, since you're updating the entire stream. I'm not familiar with its implementation personally (I'd defer to @lhorie and @tivac for that), though.

@pygy
Copy link
Member

pygy commented Mar 17, 2017

It looks weird to me as well, but I'm not very familiar with the stream code either...

@gaspoute
Copy link
Author

A little trick to get around this bug is to update without using the dependent stream returned by the mapping.

var halt = true;
var child = stream('c');
parent.map(function(p) {
    child(halt ? stream.HALT : p);
});

porsager added a commit to porsager/mithril.js that referenced this issue Aug 8, 2018
porsager added a commit to porsager/mithril.js that referenced this issue Aug 9, 2018
* Fix MithrilJS#1714 conditionally halting stream

* Add note in changelog
@porsager porsager mentioned this issue Aug 23, 2018
11 tasks
dead-claudia pushed a commit that referenced this issue Nov 14, 2018
…2194)

* output mithril, stream and ospec esm versions on build

* Add esm bundles

* [request] Clearer error message for JSON deserialization failure (#2195)

* Bundled output for commit fd7cf80 [skip ci]

* Fix #1714 conditionally halting stream (#2200)

* Fix #1714 conditionally halting stream

* Add note in changelog

* Do not include stream as named export in mithril.esm.js

* Rename mithril.min.esm.js to mithril.esm.min.js

* Add esm files to eslintignore

* Add named exports

* Add hyperscript `m` as named export

* Add builds with export changes

* checkout regular bundled files

* Change .esm.js to .mjs

* Update pkg module to point to .mjs

* Fix for export names to avoid collision

* Updated bundled files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug For bugs and any other unexpected breakage
Projects
None yet
Development

No branches or pull requests

3 participants