use-state-with-callback icon indicating copy to clipboard operation
use-state-with-callback copied to clipboard

Make lazy callback function non mandatory

Open trashhead opened this issue 1 year ago • 0 comments

When using a form I want to set a value for a state. i.e setValue("myvalue"). In that case I dont want to trigger anything after value change.

But in some cases I would like to setValue and use the callback.

So I guess this: type DispatchWithCallback<A, S> = ( value: A, callback: Callback<S>, ) => void;

should be this:

type DispatchWithCallback<A, S> = ( value: A, callback?: Callback<S>, ) => void;

trashhead avatar Aug 23 '24 07:08 trashhead