Skip to content

valterkraemer/mavo-offline

Repository files navigation

Mavo-offline

A Mavo plugin that caches data in localStorage.

Mavo-offline stores Mavo's fetched and stored data in localStorage. This means that the next time you visit the site, it will immediately show data from localStorage, and then update with the server's data when received.

This also means that you can store data even when offline. It will then send it to the server when coming online again. Even if you refresh or revisit the page later.

Mavo-offline also supports Mavo backends with server side pushes (e.g. mavo-couchdb and mavo-firebase). That means it can update the view when there have been server side changes.

Tested with Mavo version 0.1.6.

Examples

These examples have 4-way data-binding (View - Model - LocalStorage - DB) so if you open the examples in multiple windows, the data will be synchronized between them.

  • To-Do List (CouchDB) - (DEMO)
  • To-Do List (Firebase) - (DEMO)

Quick setup

  1. Add offline to mv-plugins.
  2. Add offline? before your expression in mv-storage
<main mv-app="todo"
  mv-plugins="offline"
  mv-storage="offline?couchdb=http://localhost:5984/mavo">

  ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published