Created
October 15, 2015 06:28
-
-
Save antonycourtney/ea99a40b9b2dc59c815f to your computer and use it in GitHub Desktop.
fillView 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
/* | |
* 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