• Produces a pair of objects, which allow a service to produce a stream of update promises.

    The initial state argument has to be truly optional even though it can be any first class value including undefined. We need to distinguish the presence vs the absence of it, which we cannot do with the optional argument syntax. Rather we use the arity of the initialStateArr array.

    If no initial state is provided to makeNotifierKit, then it starts without an initial state. Its initial state will instead be the state of the first update.

    Type Parameters

    • T

    Parameters

    • Rest ...initialStateArr: [] | [T]

      the first state to be returned (typed as rest array to permit undefined)

    Returns NotifierRecord<T>

    the notifier and updater

Generated using TypeDoc