Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace "elm" by "localRuntime" in JS files #124
Conversation
jvoigtlaender
added some commits
Jan 21, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Like this? |
evancz
merged commit 9c733a1
into
elm:master
Jan 21, 2015
1 check was pending
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 21, 2015
Member
Yeah, added some comments on the merge though.
Some modules do this trick where values get attached to Elm instead of just localRuntime. I generally think this is not a great idea, and I'm not sure of the benefits really. I'd be curious if there's some decisive way to know the right thing on that.
|
Yeah, added some comments on the merge though. Some modules do this trick where |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 21, 2015
Contributor
Concerning the latter point, I have no idea when to prefer attaching values to Elm. Is the default attaching them to localRuntime, and whenever the alternative is better in your judgement, you will do it yourself?
|
Concerning the latter point, I have no idea when to prefer attaching values to |
jvoigtlaender
deleted the
jvoigtlaender:localRuntime
branch
Jan 22, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 22, 2015
Member
When a module needs to call setTimeout or notify or attach event listeners, then it definitely needs to use localRuntime. You don't want to be able to accidentally notify different Elm modules in crazy ways.
When the module is stateless, it can be attached to Elm in theory. That should work for stuff like Array and List, but I have been bitten before by a module that used a guid in some indirect and surprising way that led to bugs. So it works, but it can lead to crazy bugs. Overall, it's not clear that this is a worthwhile thing to ever do.
|
When a module needs to call When the module is stateless, it can be attached to |
jvoigtlaender commentedJan 21, 2015
No description provided.