Created
October 8, 2018 15:49
-
-
Save idoshamun/4145dc63ddc43c824c18ce56f6034b7b to your computer and use it in GitHub Desktop.
Optimistic Offline-First Apps With Vuex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import store from './store'; | |
import { getState } from './storage'; | |
export default function () { | |
if (store.initialized) { | |
return Promise.resolve(); | |
} | |
return getState() | |
.then(state => store.commit('loadFromCache', state)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment