Skip to content

Instantly share code, notes, and snippets.

@antonycourtney
Created October 15, 2015 06:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save antonycourtney/7af6b62220f747b42fc0 to your computer and use it in GitHub Desktop.
scroll action in oneref-flux-challenge
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