Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
bryanjswift / machine.js
Last active November 9, 2019 01:45
Generated by XState Viz: https://xstate.js.org/viz
/**
* For a given `state` from `CompositeMachine` should the video indicated by
* `state.context.videoSrc` be in a playback state or a paused state.
* @param state node from the `CompositeMachine`.
* @returns `false` (indicating a playing state) or `true` (indicating a paused
* state). `null` or `undefined` state nodes are `true`.
*/
function isVideoPaused(state) {
if (state === null || state === undefined) {
return true;
const ComponentStateMachine = Machine({
id: 'component:record-screen',
initial: 'ssr',
states: {
ssr: {
on: {
MOUNT: {
target: 'loading',
},
},
@bryanjswift
bryanjswift / machine.js
Last active October 25, 2019 18:24
Generated by XState Viz: https://xstate.js.org/viz
//----------------------------------------
const findingDevice = {
initial: 'findingDevice',
states: {
/* BASE STATES */
foundDevice: {
type: 'final',
},
@bryanjswift
bryanjswift / machine.js
Last active March 12, 2020 19:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bryanjswift
bryanjswift / machine.js
Last active June 18, 2021 15:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bryanjswift
bryanjswift / machine.js
Last active June 18, 2021 15:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Minimal reproduction for [chakra-ui 7459][issue]

This minimal reproduction demonstrates a TypeScript compilation error for a simple component as well as a slightly more complex component when using @chakra-ui packages.

error TS2590: Expression produces a union type that is too complex to represent.