This file contains hidden or 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 defaultTheme = require("tailwindcss/defaultTheme") | |
function trimWhitespace(str) { | |
return str.split(/\s+/).join(" ").trim() | |
} | |
module.exports = { | |
purge: [ | |
"./public/**/*.html", | |
"./src/**/*.js", |
This file contains hidden or 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
import React from "react" | |
import uuid from "uuid/v4" | |
import { useImmerReducer } from "use-immer" | |
// Asserts on undefined, false, -1, null. | |
function assert(value) { | |
if (value !== undefined && value !== false && value !== -1 && value !== null) { | |
return | |
} | |
throw new Error(`assert: value assertion; value=${value}`) |
**Test**
-> <strong>test</strong>
This file contains hidden or 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
yarn tailwind build -c tailwind.test.config.js -o test.output |
This file contains hidden or 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 switchMachine = Machine({ | |
id: 'switch', | |
initial: 'disabled', | |
states: { | |
disabled: { | |
on: { | |
TOGGLE: "enabled", | |
}, | |
}, | |
enabled: { |
This file contains hidden or 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 delayedSwitch = Machine({ | |
id: "delayedSwitch", | |
initial: "disabled", | |
states: { | |
switchToDisabled: { | |
after: { | |
1e3: "disabled", | |
}, | |
}, | |
disabled: { |
This file contains hidden or 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 userMachine = Machine({ | |
id: "user", | |
initial: "loading", | |
states: { | |
loading: { | |
invoke: { | |
id: "loadingHandler", | |
src: (ctx, _) => (callback, _) => { | |
setTimeout(() => { | |
callback("success") |
This file contains hidden or 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 fetchMachine = Machine({ | |
id: "fetch", | |
initial: "fetching", | |
states: { | |
// idle: { | |
// on: { | |
// FETCH: "fetching", | |
// }, | |
// }, | |
fetching: { |
This file contains hidden or 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 naiveRefetchForeverMachine = Machine({ | |
id: "naiveRefetchForever", | |
initial: "fetching", | |
states: { | |
fetching: { | |
invoke: { | |
id: "fetchHandler", | |
src: (ctx, e) => new Promise((resolve, reject) => { | |
setTimeout(() => { | |
// if (Math.random() < 0.5) { |