A Major Scale
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | Octave |
|---|---|---|---|---|---|---|---|
| A | B | C# | D | E | F# | G# | A |
Diatonic chord progression - A Major
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| const noMechanicsAssigned = (context, event) => { | |
| return context.mechanicsAssigned < 1 | |
| } | |
| const caseMachine = Machine({ | |
| id: 'case', | |
| initial: 'open', | |
| context: { |
| Route | Duration | Miles | Things to do | Notes | Nights |
|---|---|---|---|---|---|
| Fairview to Little Rock | 4h 45m | 313 | things with kids | We dont need to spend the night here, we could spend the day here then drive to Memphis at night to stay. | 0 |
| Little Rock to Memphis | 2h 10m | 137 | tour, BBQ, Riverboat Cruise | Tour looks really good, riverboat could be good too | 1 |
| Memphis to Nashville | 3h 15m | 212 | 1 | ||
| Nashville to Atlanta | 3h 46m | This would be an alternate route instead of going to Birmingham | 1 | ||
| Atlanta to Destin FL | 5h 11m | 315 | 2 | ||
| Destin to New Orleans | 3h 57m | 252 | 2 | ||
| New Orleans to Shreveport | 5h | 327 |
React development has always had a bit of a choose your own adventure experience. By that I mean there are a LOT of choices to make in any react app. Other frameworks are much more prescriptive in how you build applications. You won't get very far down your adventure before you must make some choices in how you handle data and state within your application. React components can have state using setState in a class component or useState in a function component. That along with context is really all React gives you out of the box. Over the years there have been countless state management solutions that have risen and fallen in popularity. Have a look at React State Museum to see about 20 of the most popular approaches over the years. There was a time where it looked like Redux was going to be the clear winner and for maybe a couple of years it did seem like every enterprise react app was built with redux. It's sort of fallen out of favor in recent years. Over the
| const fetchMachine = Machine({ | |
| id: 'aog', | |
| initial: 'open', | |
| context: { | |
| }, | |
| states: { | |
| open: { | |
| initial: 'initial', | |
| on: { | |
| STALL: 'stalled', |
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Jigsaw puzzle</title> | |
| <script type="text/javascript"> | |
| function save(filename, data) | |
| { | |
| var blob = new Blob([data], {type: "text/csv"}); |
| const setSpeechNodeContext = (lang, text) => | |
| assign({ | |
| speechText: text, | |
| speechLanguage: lang, | |
| }); | |
| const setListenNodeContext = (lang, conditions) => | |
| assign({ | |
| listenConditions: conditions, |