zundo
zundo copied to clipboard
Proposal: Return function instead of undefined.
Now if I trying to call zundo funcs (undo/redo/clear) when undo / redo history is empty, zundo will return undefined instead of undo, redo, clear funcs.
I have 6 different stores and now I have to wrap each call with if (get().undo) get().undo()
for each zundo funcs.
It's not an issue but looks a little dirty. What if zundo would return a function regardless of the content of the history?
That's a good catch. Would you be able to post a code snippet so I can be certain I understand the context?
Thanks.
I'll do it later today.
Sounds good. Thanks!
Hey! Sorry for the delay, but I'm too busy this week.
I will show an example with a bug this weekend.
Sounds good. I'm busy as well so this weekend will be great. Thanks!
This is no longer an issue in v2. Thanks for the great suggestion!