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

Laziness & mutable data structure #4

Open
green-coder opened this issue Aug 25, 2021 · 0 comments
Open

Laziness & mutable data structure #4

green-coder opened this issue Aug 25, 2021 · 0 comments

Comments

@green-coder
Copy link
Contributor

About this line:

(register-printer js/DocumentFragment 'js/DocumentFragment #(map hiccupize (.-children %)))

The laziness of the returned sequence means that if the output value is not eagerly consumed in a timely manner, the value might not be consistent with the state of the DOM at a given point in time, because the DOM can be mutated.

To be safe, I suggest to change it to:

(register-printer js/DocumentFragment 'js/DocumentFragment #(seq (mapv hiccupize (.-children %))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant