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

Question: how does the change event get triggered? #16

Closed
alessioalex opened this Issue Apr 6, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@alessioalex

alessioalex commented Apr 6, 2015

Hey @latentflip I was just wondering how does the change event get triggered for the domthing example? I'm having a hard time understanding this. I've looked at ampersand-state but I'm either too tired or the change is not being triggered there. Thank you.

/cc @HenrikJoreteg

Thanks guys.

@alessioalex

This comment has been minimized.

Show comment
Hide comment
@alessioalex

alessioalex Apr 6, 2015

The confusing thing to me is that you are not using .set() to update the value, so I'm guessing you are probably using Object.defineProperty() with custom setters somewhere..?

alessioalex commented Apr 6, 2015

The confusing thing to me is that you are not using .set() to update the value, so I'm guessing you are probably using Object.defineProperty() with custom setters somewhere..?

@alessioalex

This comment has been minimized.

Show comment
Hide comment

@alessioalex alessioalex closed this Apr 6, 2015

@latentflip

This comment has been minimized.

Show comment
Hide comment
@latentflip

latentflip Apr 6, 2015

Contributor

@alessioalex heads up that the future of domthing looks tentative :) it's probably unlikely it'll make a full production-quality release if I'm honest, as combining react + ampersand has probably a stronger future than I can support with domthing. But, feel free to play with it :)

Contributor

latentflip commented Apr 6, 2015

@alessioalex heads up that the future of domthing looks tentative :) it's probably unlikely it'll make a full production-quality release if I'm honest, as combining react + ampersand has probably a stronger future than I can support with domthing. But, feel free to play with it :)

@alessioalex

This comment has been minimized.

Show comment
Hide comment
@alessioalex

alessioalex Apr 7, 2015

To be honest I'm not too fond of React. I dislike JSX and writing all my template code in JavaScript. domthing might not be React, but it's simple and gets the job done.

I think the only thing I would change is making it render stuff with setImmediate or something, in case there are other changes in the same event loop tick: https://github.com/AmpersandJS/ampersand-domthing-mixin/blob/master/index.js#L8-L14

TL;DR Love the simplicity of Ampersand with this module, dislike React inliny templates.

@latentflip btw, are there any Ampersand with React examples? Would like to replicate an example with domthing.

alessioalex commented Apr 7, 2015

To be honest I'm not too fond of React. I dislike JSX and writing all my template code in JavaScript. domthing might not be React, but it's simple and gets the job done.

I think the only thing I would change is making it render stuff with setImmediate or something, in case there are other changes in the same event loop tick: https://github.com/AmpersandJS/ampersand-domthing-mixin/blob/master/index.js#L8-L14

TL;DR Love the simplicity of Ampersand with this module, dislike React inliny templates.

@latentflip btw, are there any Ampersand with React examples? Would like to replicate an example with domthing.

@latentflip

This comment has been minimized.

Show comment
Hide comment
@latentflip

latentflip Apr 7, 2015

Contributor

@alessioalex this already happens, it just happens within domthing. Renders are queued until the next requestAnimationFrame fires: https://github.com/latentflip/domthing/blob/master/lib/runtime/template.js#L35-L38

Contributor

latentflip commented Apr 7, 2015

@alessioalex this already happens, it just happens within domthing. Renders are queued until the next requestAnimationFrame fires: https://github.com/latentflip/domthing/blob/master/lib/runtime/template.js#L35-L38

@alessioalex

This comment has been minimized.

Show comment
Hide comment
@alessioalex

alessioalex Apr 7, 2015

@latentflip thank you for your prompt feedback, really appreciate it. Well I guess this module is just perfect for some use cases then :D I'll go along and play with it :)

alessioalex commented Apr 7, 2015

@latentflip thank you for your prompt feedback, really appreciate it. Well I guess this module is just perfect for some use cases then :D I'll go along and play with it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment