- Must: Pycharm refactoring must work (this, plus PEP XXX's recommendation not to use relative imports, means I have to use absolute imports.
- Which: src or no source?
- Which: Packaging utilities? (setup tools + twine, flit, xxxx?)
- Must: Pytest tests must work
- How: Developer environment (ie I don't want to have to install before running my code). Tox?
- How: imports? relative? absolute? import the installed package?
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
const pedestrianStates = { | |
key: 'peds', | |
initial: 'walk', | |
states: { | |
walk: { | |
on: { | |
PED_COUNTDOWN: 'wait' | |
} | |
}, |
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
const clueTurnMachine = { | |
id: 'clue-turn-machine', | |
initial: 'begin_turn', | |
states: { | |
begin_turn: { | |
on: {NEXT: 'choosing_clue'}, | |
after: {5000: 'showing_target_word'} | |
}, | |
showing_target_word: { | |
on: {NEXT: 'choosing_clue'}, |
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
const hiddenClues = { | |
id: 'hiddenClues', | |
initial: 'thinking', | |
states: { | |
thinking: { | |
on: { | |
SUBMIT_CLUE: { | |
target: 'waiting', | |
cond: 'isSelfEvent', | |
} |
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
// https://xstate.js.org/viz/?gist=360718e57b8550e05dc5554b953de3af | |
const local = { | |
on: { | |
CANCEL: '#deleted', | |
SAVE: { | |
target: '#active', | |
cond: 'isPartiallyValidated', | |
}, | |
SUBMIT: { |
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
const buttonA = { | |
id: 'buttonA', | |
initial: 'hist', | |
states: { | |
off: { | |
on: { | |
TOGGLEA: 'on' | |
} |
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
const buttonFactory = id => { | |
const toggleName = `TOGGLE${id}` | |
return { | |
id: `button${id}`, | |
initial: 'hist', | |
states: { | |
off: { | |
on: { | |
[toggleName]: 'on' | |
} |
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
const buttonFactory = id => { | |
const toggleName = `TOGGLE${id}` | |
return { | |
id: `button${id}`, | |
initial: 'hist', | |
states: { | |
off: { | |
on: { | |
[toggleName]: 'on' | |
} |
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
const buttonFactory = id => { | |
const toggleName = `TOGGLE${id}` | |
return { | |
id: `button${id}`, | |
initial: 'hist', | |
states: { | |
off: { | |
on: { | |
[toggleName]: 'on' | |
} |
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
const guards = { | |
isSelf: ()=>false, | |
} | |
const eventConflicts = Machine({ | |
id: 'conflicts', | |
initial: 'first', | |
on: { | |
SUBMIT: 'third', | |
}, |
OlderNewer