Created
October 6, 2020 23:43
-
-
Save edgerunner/b1bd3e6d8d1d0f7c59608ae2f5219ae1 to your computer and use it in GitHub Desktop.
SWR&
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
SWR& | |
Data | |
success -> Fresh | |
None | |
Some | |
Fresh | |
after stale -> Stale | |
Stale | |
Transfer | |
after stale -> Pending | |
Pending | |
success -> Done | |
failure -> Failed | |
Done | |
Failed | |
after retry -> Pending | |
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
function render(model){ | |
analyse(model, "Tolga") | |
let current_state_name = model.active_states.map(s => s.name); | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} | |
function analyse(machine, input) { | |
for (char in input.toLowerCase()) { | |
if ("aeıioöuü".includes(char)) { | |
machine.emit(char) | |
} else { | |
machine.emit("consonant") | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment