Skip to content

Instantly share code, notes, and snippets.

@aynik
Last active April 11, 2020 06:00
Show Gist options
  • Save aynik/80c65fb16781fff93b5132f7f061c3a0 to your computer and use it in GitHub Desktop.
Save aynik/80c65fb16781fff93b5132f7f061c3a0 to your computer and use it in GitHub Desktop.
const SOLID = "SOLID";
const LIQUID = "LIQUID";
const GAS = "GAS";
const transitions = {
[SOLID]: {
melt: LIQUID,
sublimate: GAS,
},
[LIQUID]: {
vaporize: GAS,
freeze: SOLID,
},
[GAS]: {
condensate: LIQUID,
deposit: SOLID,
},
};
function nextTransition(transitions: ???) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment