Skip to content

Handle callbacks in set/redo calls#20

Closed
gorj-tessella wants to merge 1 commit intohomerchen19:masterfrom
gorj-tessella:master
Closed

Handle callbacks in set/redo calls#20
gorj-tessella wants to merge 1 commit intohomerchen19:masterfrom
gorj-tessella:master

Conversation

@gorj-tessella
Copy link
Copy Markdown

Ordinary useState/setState accepts a callback as the argument which is evaluated with the previous state, so useUndo/set/reset should as well.

@AntonioClarke
Copy link
Copy Markdown

Ordinary useState/setState accepts a callback as the argument which is evaluated with the previous state, so useUndo/set/reset should as well.

Would the typescript declaration have to be updated as well? https://github.com/homerchen19/use-undo/blob/master/index.d.ts

@homerchen19
Copy link
Copy Markdown
Owner

Closing as no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants