Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAtom<T>

Type parameters

  • T

Hierarchy

Implemented by

Index

Methods

addWatch

  • addWatch(id: string, fn: Watch<T>): boolean
  • Parameters

    • id: string
    • fn: Watch<T>

    Returns boolean

deref

  • deref(): T
  • Returns wrapped value.

    Returns T

notifyWatches

  • notifyWatches(oldState: T, newState: T): void

release

  • release(opt?: any): boolean
  • Parameters

    • Optional opt: any

    Returns boolean

removeWatch

  • removeWatch(id: string): boolean

reset

  • reset(val: T): T

resetIn

  • resetIn(path: readonly [], val: T): T
  • resetIn<A>(path: Path1<T, A>, val: ValNReducer<T, A, []>): T
  • resetIn<A, B>(path: Path2<T, A, B>, val: ValNReducer<T, A, [B]>): T
  • resetIn<A, B, C>(path: Path3<T, A, B, C>, val: ValNReducer<T, A, [B, C]>): T
  • resetIn<A, B, C, D>(path: Path4<T, A, B, C, D>, val: ValNReducer<T, A, [B, C, D]>): T
  • resetIn<A, B, C, D, E>(path: Path5<T, A, B, C, D, E>, val: ValNReducer<T, A, [B, C, D, E]>): T
  • resetIn<A, B, C, D, E, F>(path: Path6<T, A, B, C, D, E, F>, val: ValNReducer<T, A, [B, C, D, E, F]>): T

resetInUnsafe

  • resetInUnsafe(path: Path, val: any): T

swap

  • swap(fn: SwapFn<T, T>, ...args: any[]): T

swapIn

  • swapIn<A>(path: readonly [], fn: SwapFn<T, T>, ...args: any[]): T
  • swapIn<A>(path: Path1<T, A>, fn: SwapFn<OptVal<IsOptR<T, A, []>, ValNReducer<T, A, []>>, ValNReducer<T, A, []>>, ...args: any[]): T
  • swapIn<A, B>(path: Path2<T, A, B>, fn: SwapFn<OptVal<IsOptR<T, A, [B]>, ValNReducer<T, A, [B]>>, ValNReducer<T, A, [B]>>, ...args: any[]): T
  • swapIn<A, B, C>(path: Path3<T, A, B, C>, fn: SwapFn<OptVal<IsOptR<T, A, [B, C]>, ValNReducer<T, A, [B, C]>>, ValNReducer<T, A, [B, C]>>, ...args: any[]): T
  • swapIn<A, B, C, D>(path: Path4<T, A, B, C, D>, fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D]>, ValNReducer<T, A, [B, C, D]>>, ValNReducer<T, A, [B, C, D]>>, ...args: any[]): T
  • swapIn<A, B, C, D, E>(path: Path5<T, A, B, C, D, E>, fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D, E]>, ValNReducer<T, A, [B, C, D, E]>>, ValNReducer<T, A, [B, C, D, E]>>, ...args: any[]): T
  • swapIn<A, B, C, D, E, F>(path: Path6<T, A, B, C, D, E, F>, fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D, E, F]>, ValNReducer<T, A, [B, C, D, E, F]>>, ValNReducer<T, A, [B, C, D, E, F]>>, ...args: any[]): T
  • Type parameters

    • A

    Parameters

    • path: readonly []
    • fn: SwapFn<T, T>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    Parameters

    • path: Path1<T, A>
    • fn: SwapFn<OptVal<IsOptR<T, A, []>, ValNReducer<T, A, []>>, ValNReducer<T, A, []>>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    • B

    Parameters

    • path: Path2<T, A, B>
    • fn: SwapFn<OptVal<IsOptR<T, A, [B]>, ValNReducer<T, A, [B]>>, ValNReducer<T, A, [B]>>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    • B

    • C

    Parameters

    • path: Path3<T, A, B, C>
    • fn: SwapFn<OptVal<IsOptR<T, A, [B, C]>, ValNReducer<T, A, [B, C]>>, ValNReducer<T, A, [B, C]>>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    • B

    • C

    • D

    Parameters

    • path: Path4<T, A, B, C, D>
    • fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D]>, ValNReducer<T, A, [B, C, D]>>, ValNReducer<T, A, [B, C, D]>>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    Parameters

    • path: Path5<T, A, B, C, D, E>
    • fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D, E]>, ValNReducer<T, A, [B, C, D, E]>>, ValNReducer<T, A, [B, C, D, E]>>
    • Rest ...args: any[]

    Returns T

  • Type parameters

    • A

    • B

    • C

    • D

    • E

    • F

    Parameters

    • path: Path6<T, A, B, C, D, E, F>
    • fn: SwapFn<OptVal<IsOptR<T, A, [B, C, D, E, F]>, ValNReducer<T, A, [B, C, D, E, F]>>, ValNReducer<T, A, [B, C, D, E, F]>>
    • Rest ...args: any[]

    Returns T

swapInUnsafe

  • swapInUnsafe(path: Path, fn: SwapFn<any, any>, ...args: any[]): T

Generated using TypeDoc