Options
All
  • Public
  • Public/Protected
  • All
Menu

An object whose internal state can be updated.

Type parameters

  • T

    type of the internal state

Hierarchy

Index

Properties

Properties

update

update: (updater: (prev: T) => T) => T

Update the internal state using the provided callback.

Note: If the callback returns the same instance of the state (i.e. returns the prev argument) the implementations are safe to assume that no update happened and can act so (e.g. skip any notification or post-processing).

param

callback that receives previous state and is supposed to return a new one

returns

the new state after the update is applied

Type declaration

    • (updater: (prev: T) => T): T
    • Parameters

      • updater: (prev: T) => T
          • (prev: T): T
          • Parameters

            • prev: T

            Returns T

      Returns T

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc