collection of mermaid.live charts
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 fetchLocations = async () => { | |
// fake response | |
return new Promise(resolve => setTimeout(() => resolve(["foo", "bar", "baz"]), 1000)); | |
// return fetch(`/api/notion/locations`).then((response) => response.json()); | |
} | |
const updateLocations = (_c, evt) => { | |
const { query } = evt; | |
console.log(query); // { AGES: "18_TO_49" } |
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 fooMachine = Machine({ | |
id: 'foo', | |
initial: 'loading', | |
// Local context for entire machine | |
context: { | |
retries: 0, | |
activeFilter: {}, | |
}, |
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
// truncated version of my attempt to adapt https://glitch.com/~spotify-web-api-node into Netlify functions | |
const SpotifyWebApi = require("spotify-web-api-node"); | |
const TEST_ARTIST_ID = "1lYT0A0LV5DUfxr6doRP3d"; | |
let accessToken; | |
const spotifyApi = new SpotifyWebApi({ | |
clientId: process.env.SPOTIFY_CLIENT_ID, |
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 tapStates = { | |
initial: 'tapOff', | |
states: { | |
tapOff: { | |
on: { | |
TAP_ON: 'tapOn' | |
} | |
}, | |
tapOn: { | |
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 tapStates = { | |
initial: 'tapOff', | |
states: { | |
tapOff: { | |
on: { | |
TURN_ON: 'tapOn' | |
} | |
}, | |
tapOn: { | |
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 handWashMachine2b = Machine({ | |
id: 'handwash', | |
initial: 'unwashed', | |
states: { | |
unwashed: { | |
on: { | |
START_WASH: 'washing' | |
} | |
}, |
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 handWashMachine2 = Machine({ | |
id: 'handwash', | |
initial: 'unwashed', | |
states: { | |
unwashed: { | |
on: { | |
START_WASH: 'washing' | |
} | |
}, | |
washing: { |
NewerOlder