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 * as React from 'react' | |
import { stream, scan } from 'flyd' | |
import merge from 'mergerino' | |
interface StreamedStateConfigObject<T, A> { | |
state: T, actions: (updater: (value: Partial<T>) => void) => A | |
} | |
type StreamedStateConfigBuilder<T, A> = () => StreamedStateConfigObject<T, A> |
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
<script role="view"> | |
import { store, view } from 'react-easy-state' | |
const counter = store({ | |
value: 0, | |
increment() { counter.value += 1 }, | |
decrement() { counter.value -= 1 } | |
}) | |
export default view(() => ( |
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
* { | |
scroll-behavior: smooth; | |
box-sizing: border-box; | |
} | |
.modal-card { | |
box-shadow: 0px 6px 8px rgba(0,0,0,.5); | |
border-radius: 6px; | |
} |
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, { useCallback, createContext, useEffect, createRef, Fragment } from 'react' | |
import { createPortal } from 'react-dom' | |
import { store, view } from '@risingstack/react-easy-state' | |
const DIALOG_CANCEL = Symbol("Dialog(cancel)") | |
const INTERNALS = Symbol("Dialog(internals)") | |
const DialogContext = createContext() | |
const state = store({ | |
dialogs: [], |
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
<script> | |
import React from 'react' | |
import styles from './' | |
export default () => { | |
const [items, setItems] = React.useState([{id:1, text: 'First'}]) | |
return ( | |
<div className={styles.Test}> | |
<header>This is a Test</header> |
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 { UIController, useController } from '../core' | |
import { stylesheet } from '../theme' | |
import { DomainObjectList } from 'fp-api' | |
type EmailAddressListProps = { | |
customerId: number | |
} | |
class EmailAddressListController extends UIController<EmailAddressListProps> { |
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
extends Node | |
# Be sure to AutoLoad me as a singleton | |
# Enumerate all your game events here... | |
enum { | |
GAME_STARTED, | |
GAME_OVER | |
} |
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 { derive, readable, writable } from 'svelte/store.js' | |
import { produce } from 'immer' | |
export const update = produce | |
export function computed(deps, reactor) { | |
const source = derive(deps, reactor) | |
return { | |
subscribe: source.subscribe, | |
get snapshot() { return getSnapshot(source) } |
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 { store } from "react-easy-state"; | |
interface PersistAPI<T = any> { | |
applySnapshot: (data: T) => void | |
getSnapshot: () => T | |
isLoaded: boolean | |
load: () => void | |
save: () => void | |
saveImmediately: () => void | |
} |
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 _constructing: Set<any> = new Set() | |
const _services: Map<any, any> = new Map() | |
const _serviceOverrides: Map<any, any> = new Map() | |
interface Type<T> { new(...args: any[]): T } | |
function createInstance(CTor: any, args: any[] = []): any { | |
if (!CTor) { | |
// debugger | |
throw new Error(`Null or undefined dependency specified.`) |