Skip to main content Link Search Menu Expand Document (external link)

MutableRef overview

Added in v2.0.0


Table of contents


boolean

toggle

Signature

export declare const toggle: (self: MutableRef<boolean>) => MutableRef<boolean>

Added in v2.0.0

constructors

make

Signature

export declare const make: <T>(value: T) => MutableRef<T>

Added in v2.0.0

general

compareAndSet

Signature

export declare const compareAndSet: {
  <T>(oldValue: T, newValue: T): (self: MutableRef<T>) => boolean
  <T>(self: MutableRef<T>, oldValue: T, newValue: T): boolean
}

Added in v2.0.0

get

Signature

export declare const get: <T>(self: MutableRef<T>) => T

Added in v2.0.0

getAndSet

Signature

export declare const getAndSet: { <T>(value: T): (self: MutableRef<T>) => T; <T>(self: MutableRef<T>, value: T): T }

Added in v2.0.0

getAndUpdate

Signature

export declare const getAndUpdate: {
  <T>(f: (value: T) => T): (self: MutableRef<T>) => T
  <T>(self: MutableRef<T>, f: (value: T) => T): T
}

Added in v2.0.0

set

Signature

export declare const set: {
  <T>(value: T): (self: MutableRef<T>) => MutableRef<T>
  <T>(self: MutableRef<T>, value: T): MutableRef<T>
}

Added in v2.0.0

setAndGet

Signature

export declare const setAndGet: { <T>(value: T): (self: MutableRef<T>) => T; <T>(self: MutableRef<T>, value: T): T }

Added in v2.0.0

update

Signature

export declare const update: {
  <T>(f: (value: T) => T): (self: MutableRef<T>) => MutableRef<T>
  <T>(self: MutableRef<T>, f: (value: T) => T): MutableRef<T>
}

Added in v2.0.0

updateAndGet

Signature

export declare const updateAndGet: {
  <T>(f: (value: T) => T): (self: MutableRef<T>) => T
  <T>(self: MutableRef<T>, f: (value: T) => T): T
}

Added in v2.0.0

models

MutableRef (interface)

Signature

export interface MutableRef<out T> extends Pipeable, Inspectable {
  readonly [TypeId]: TypeId

  /** @internal */
  current: T
}

Added in v2.0.0

numeric

decrement

Signature

export declare const decrement: (self: MutableRef<number>) => MutableRef<number>

Added in v2.0.0

decrementAndGet

Signature

export declare const decrementAndGet: (self: MutableRef<number>) => number

Added in v2.0.0

getAndDecrement

Signature

export declare const getAndDecrement: (self: MutableRef<number>) => number

Added in v2.0.0

getAndIncrement

Signature

export declare const getAndIncrement: (self: MutableRef<number>) => number

Added in v2.0.0

increment

Signature

export declare const increment: (self: MutableRef<number>) => MutableRef<number>

Added in v2.0.0

incrementAndGet

Signature

export declare const incrementAndGet: (self: MutableRef<number>) => number

Added in v2.0.0

symbol

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v2.0.0