Options
All
  • Public
  • Public/Protected
  • All
Menu

Package render

@typed/render

An interface-driven rendering system for @typed/hooks, capable of integrating with many JS view/rendering libraries.

Index

Type aliases

KeyOf

KeyOf<A, Key>: {}

Type parameters

  • A

  • Key: PropertyKey

Type declaration

Variables

Const DomEnvChannel

DomEnvChannel: Channel<DomEnv<unknown>, DomEnv<unknown>> = createChannel<DomEnv, DomEnv>(get)

Functions

createTestRafEnv

  • createTestRafEnv(timer: Timer, delayMs?: number): RafEnv

patch

  • patch<E, A, B>(previous: A, renderable: B): Effects<E & PatchEnv<A, B>, A>

patchOnRaf

  • patchOnRaf<E, A, B, C>(fn: () => HookEffects<A, B>, initial: C): HookEffects<E & A & RafEnv & PatchEnv<C, B, E>, never>

raf

  • raf(): Effects<RafEnv, number>

useDomEnv

  • useDomEnv<A>(): ChannelEffects<HookEnv & TimerEnv & DomEnv<A>, DomEnv<A>>

useHookEnvUpdated

  • useHookEnvUpdated(env: HookEnvironment, onUpdated: () => Disposable): Generator<Env<HooksManagerEnv, HooksManagerEnv> | Env<HookEnv, any>, Disposable, any>
  • Listen for updated events regarding a particular hook environment.

    Parameters

    • env: HookEnvironment
    • onUpdated: () => Disposable
        • (): Disposable
        • Returns Disposable

    Returns Generator<Env<HooksManagerEnv, HooksManagerEnv> | Env<HookEnv, any>, Disposable, any>

useKeyManager

  • useKeyManager<E, B, C>(key: object, render: (...ref: UseRef<C>) => HookEffects<E, B>, initial?: C | null): ChannelEffects<HookEnv & TimerEnv & PatchEnv<C, B> & E, B>
  • Used to manage a help manage re-rendering a patchable instance

    Type parameters

    • E

    • B

    • C

    Parameters

    • key: object
    • render: (...ref: UseRef<C>) => HookEffects<E, B>
        • (...ref: UseRef<C>): HookEffects<E, B>
        • Parameters

          Returns HookEffects<E, B>

    • Optional initial: C | null

    Returns ChannelEffects<HookEnv & TimerEnv & PatchEnv<C, B> & E, B>

useListManager

  • useListManager<A, B, E, C, D>(list: ReadonlyArray<A>, identify: Arity1<A, B>, computation: (ref: UseRef<D>[0], setRef: UseRef<D>[1], value: A, index: number) => HookEffects<E, C>): HookEffects<E & TimerEnv & HooksManagerEnv & PatchEnv<D, C>, ReadonlyArray<C>>
  • Type parameters

    • A

    • B: PropertyKey

    • E

    • C

    • D

    Parameters

    • list: ReadonlyArray<A>
    • identify: Arity1<A, B>
    • computation: (ref: UseRef<D>[0], setRef: UseRef<D>[1], value: A, index: number) => HookEffects<E, C>
        • (ref: UseRef<D>[0], setRef: UseRef<D>[1], value: A, index: number): HookEffects<E, C>
        • Parameters

          • ref: UseRef<D>[0]
          • setRef: UseRef<D>[1]
          • value: A
          • index: number

          Returns HookEffects<E, C>

    Returns HookEffects<E & TimerEnv & HooksManagerEnv & PatchEnv<D, C>, ReadonlyArray<C>>

useMatchManager

  • useMatchManager<A, E, B, C>(matchAgainst: A, matches: ReadonlyArray<Match<A, (ref: UseRef<C>[0], setRef: UseRef<C>[1]) => HookEffects<E, B>>>, initial?: C | null): ChannelEffects<E & TimerEnv & HookEnv & PatchEnv<C, B>, Maybe<B>>

Generated using TypeDoc