andywer / ideabox

Place to collect techy ideas and get feedback.
1 stars 1 forks source link

Library to easily make forms offline-capable #12

Open andywer opened 7 years ago

andywer commented 7 years ago

There should be an easy way to hook a form's onSubmit to a small library that checks if you are offline and if so, writes the data to localstorage and submits when back online.

Should be really easy to create a custom UI response for the offline use case. Also needs to provide an observable or similar per form to inform the application code when the data gets sent.

Inspired by https://mxb.at/blog/offline-forms/. See https://developer.mozilla.org/en/docs/Online_and_offline_events.