Type alias Updater<T>

Updater<T>: ((draft: Draft<T>) => UpdaterResult<T> | Promise<UpdaterResult<T>>)

Type Parameters

  • T

Type declaration

    • (draft: Draft<T>): UpdaterResult<T> | Promise<UpdaterResult<T>>
    • Updater for type T.

      If the function does not return, or the resulting promise does not resovle to a value, the value is assumed to be updated in-place.

      If the function returns nothing or resolves to nothing, the value will be cleared.

      Parameters

      • draft: Draft<T>

      Returns UpdaterResult<T> | Promise<UpdaterResult<T>>

Generated using TypeDoc