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
| export type TEventTriggerPayload<TData> = { | |
| event: ( | |
| | TEvent<'INSERT', null, TData> | |
| | TEvent<'UPDATE', TData, TData> | |
| | TEvent<'DELETE', TData, null> | |
| | TEvent<'MANUAL', null, TData> | |
| ) & { | |
| session_variables: Dictionary | |
| } | |
| created_at: ISODateTime |
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 NoChildrenAllowed: ReactFC<NoChildren> = () => null | |
| const RequireSingleChild: ReactFC<Required<SingleChild>> = () => null | |
| type TProps = Required<SomeChildren> & { | |
| otherProp: number | |
| } | |
| const RequireMoreChildrenAndOtherProps: ReactFC<TProps> = () => null |
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 audioStreamMachine = Machine({ | |
| id: 'audioStream', | |
| initial: 'idle', | |
| context: { | |
| stream: null, | |
| streamError: null, | |
| }, | |
| states: { | |
| idle: { | |
| on: { |
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 tickEvent = (gear) => ({ type: 'TICK', gear }) | |
| const trainMachine = Machine( | |
| { | |
| id: 'train', | |
| initial: 'inactive', | |
| context: { | |
| position: { | |
| x: 0, | |
| y: 0, |
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 reset = assign({ | |
| value: ({ initialValue }) => initialValue | |
| }) | |
| const updateValue = assign({ | |
| value: (_, ev) => ev.value | |
| }) | |
| const isEnterOrTab = (_, ev) => ['Enter', 'Tab'].includes(ev.key) |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions | |
| // - XState (all XState exports) |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
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 { observer } from 'mobx-react-lite' | |
| const RandomGiphy = observer(() => { | |
| const settings = useSettings() | |
| const giphy = useRandomGiphy(settings.tag) | |
| return giphy ? <img src={giphy.url} /> : null | |
| }) |
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' | |
| const context = React.createContext(mobx.observable({ | |
| tag: 'kittens' | |
| })) | |
| export const SettingsProvider = ({ children }) => { | |
| // we can employ some persistence here and load previous settings | |
| // for now just return children because context already has state set | |
| return children |
NewerOlder