Type Alias OnUseFn<T>

OnUseFn<T>: ((arg: OnUseArgument<T>) => void | Unsubscriber)

Type of a function that is called when the number of subscribers changes from 0 to 1 (but not called when the number of subscribers changes from 1 to 2, ...).

If it returns a function, that function will be called when the number of subscribers changes from 1 to 0.

Type Parameters

  • T