Skip to content

Instantly share code, notes, and snippets.

@antonycourtney
Created October 15, 2015 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonycourtney/ea99a40b9b2dc59c815f to your computer and use it in GitHub Desktop.
Save antonycourtney/ea99a40b9b2dc59c815f to your computer and use it in GitHub Desktop.
fillView action in oneref-flux-challenge
/*
* fill view by generating more requests if necessary
*/
function fillView(st,updater) {
const lastSith = st.lastKnownSith();
if (st.needsApprentice(lastSith)) {
requestSithInfo(true,lastSith.info.apprenticeId,updater);
} else {
const firstSith = st.firstKnownSith();
if (st.needsMaster(firstSith)) {
requestSithInfo(false,firstSith.info.masterId,updater);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment