simsalabim / sisyphus

Gmail-like client-side drafts and bit more. Plugin developed to save html forms data to LocalStorage to restore them after browser crashes, tabs closings and other disasters.
http://sisyphus-js.herokuapp.com
MIT License
1.99k stars 221 forks source link

Add onBeforeRestoreAll and onRestoreAll #154

Closed brendon closed 1 month ago

brendon commented 6 years ago

onBeforeRestore and onRestore are now granular and provide the target form. They also don't trigger if there is no data to restore for that particular form.

onBeforeRestoreAll and onRestoreAll operate like onBeforeRestore and onRestore used to.

No tests so far.

Potential to close #138 with more work.

brendon commented 6 years ago

I just wanted to float this concept before cleaning it up (documentation and tests). What do you think? I know it breaks the existing API but it's better to rename the methods to *All rather than call the new methods and callbacks onRestoreTarget IMO, but we could look at that as an alternative.

brendon commented 1 month ago

Ended up rolling my own solution in the end.