Closed esidegallery closed 5 years ago
I'd like for it to return early consistently, even if there is no showEffect or hideEffect specified. Technically, it shouldn't matter if you return early or not when there are no effects, but I prefer not having to take that extra few seconds to think about it when I'm reading through the code.
With that in mind, I think that the new value of visible probably needs to be stored in a variable so that it can be checked before the effect completes. Can you make that change?
Something like this? The new value is stored in a pending variable, which is applied when appropriate.
Looks good to me. I'll merge it once I see that Travis CI has finished running tests.
Great, thanks Josh.
p.s. I missed a this
on line 3698!
p.s. I missed a
this
on line 3698!
Yeah, I noticed. 😄
I can fix it after the merge.
I noticed that the commit fixing issue #1787 won't always work as expected. For example, hideEffect only sets super.visible to false when it's finished running. If hideEffect is running, setting visible = true will be ignored allowing the effect to continue, and setting to false will interrupt the effect. I have updated it so that it returns only if the new value's corresponding effect is running. Otherwise it carries on as before. I haven't fully tested this, as I'm running the SDK.