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 upFix fpsWhen, including consideration for hotswapping #143
Conversation
jvoigtlaender
added some commits
Jan 26, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jwmerrill
Jan 26, 2015
What's the reason for this? Does, e.g., plain fps (which starts with a true value for isOn) not start without it?
jwmerrill
commented on src/Native/Time.js in e495feb
Jan 26, 2015
|
What's the reason for this? Does, e.g., plain fps (which starts with a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 26, 2015
Owner
Exactly. Note that with foldp below, the update-functions isn't called on signal initialization at all. The initial value of a foldp is the explicit initial value argument, not anything obtained from a call of the updating function. So without this here, no timeout will be created at signal initialization (since the only other call to setTimeout is in the update-function, which will not get invoked).
|
Exactly. Note that with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jwmerrill
Jan 26, 2015
Another alternative would be to unroll the foldp one step, so replace
A3(Signal.foldp, F2(update), initialState, input)
in line 68 with
A3(Signal.foldp, F2(update), update(input.value, initialState), input)
In that case, you'd also want initialState.wasOn to start false in line 37.
If you did that, you could drop the conditional here.
The advantage of unrolling is that it's more obvious that you won't end up with two timeout loops running in parallel.
jwmerrill
replied
Jan 26, 2015
|
Another alternative would be to unroll the
in line 68 with
In that case, you'd also want If you did that, you could drop the conditional here. The advantage of unrolling is that it's more obvious that you won't end up with two timeout loops running in parallel. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 26, 2015
Owner
Oh yes, I like that. Also, concerning the initial value handling it brings back some clarity that was a quality of the non-foldp version.
|
Oh yes, I like that. Also, concerning the initial value handling it brings back some clarity that was a quality of the non- |
jvoigtlaender
added some commits
Jan 26, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Great. This looks good to me. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Great work guys, this looks really good! |
pushed a commit
that referenced
this pull request
Jan 26, 2015
evancz
merged commit 21dad1f
into
elm:master
Jan 26, 2015
1 check passed
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 26, 2015
Contributor
Looks like I pushed this commit: jvoigtlaender@f11f7ca too late, it occurs in my branch but not in the merge.
Think it is relevant?
|
Looks like I pushed this commit: jvoigtlaender@f11f7ca too late, it occurs in my branch but not in the merge. Think it is relevant? |
jvoigtlaender
referenced this pull request
Feb 6, 2015
Merged
Don't make timeoutId in fpsWhen part of the state stored in signal graph. #160
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Feb 6, 2015
Contributor
I followed up my previous question with a new pull request (#160).
|
I followed up my previous question with a new pull request (#160). |
jvoigtlaender commentedJan 26, 2015
fixes #139
yet another alternative to #141 and #142
based on @jwmerrill's version of
fpsWhenAll local state now packaged in a signal, to allow Elm Reactor to pick it up during hotswapping.