Created
October 15, 2015 06:32
-
-
Save antonycourtney/7af6b62220f747b42fc0 to your computer and use it in GitHub Desktop.
scroll action in oneref-flux-challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function scroll(scrollAmount,updater) { | |
updater((prevState) => { | |
const {nextState, oldRequests} = prevState.scrollAdjust(scrollAmount); | |
oldRequests.forEach((req) => req.abort()); // cancel old requests | |
// Need invokeLater since we're within updater | |
invokeLater(() => fillView(nextState,updater)); | |
return nextState; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment