Redux, MobX, VueX, Pinia, Context, Hooks, UserData - sgml/signature GitHub Wiki
UserData predates all other offline data stores:
<!DOCTYPE html>
<html>
<head>
<title>UserData Example</title>
<script>
function saveData() {
var el = document.getElementById('dataElement');
el.setAttribute('data', document.getElementById('input').value);
el.save('myStore');
}
function loadData() {
var el = document.getElementById('dataElement');
el.load('myStore');
document.getElementById('input').value = el.getAttribute('data');
}
</script>
</head>
<body onload="loadData()">
<input type="text" id="input" />
<button onclick="saveData()">Save</button>
<span id="dataElement" style="behavior:url('#default#userData')"></span>
</body>
</html>
Start with a Database Abstraction, such as PouchDB, then create a plugin for it. From there, use the Interceptor Pattern to migrate from one framework to another:
- AngularJS factory => VueX mutation
- AngularJS constant => VueX state
- AngularJS provider => VueX getter
- AngularJS controller => VueX actions
import Vue from 'vue'; import Vuex from 'vuex'; import { createPinia, defineStore } from 'pinia'; export function createStore(version) { if (version === 'vue2') { Vue.use(Vuex); return new Vuex.Store({ state: {}, mutations: {}, actions: {}, getters: {} }); } else if (version === 'vue3') { const pinia = createPinia(); return defineStore('main', { state: () => ({}), actions: {}, getters: {} })(); } else { throw new Error('Invalid version specified. Use "vue2" or "vue3".'); } }
- https://pouchdb.com/external.html#framework_adapters
- https://github.com/ActiveEngagement/pinia-pouchdb-plugin/blob/master/README.md
- https://pinia.vuejs.org/core-concepts/state.html#Subscribing-to-the-state
- https://v2.vuejs.org/v2/cookbook/client-side-storage.html
- https://vueuse.org/core/useStorage/
- https://dexie.org/docs/Tutorial/Vue
- https://levelup.gitconnected.com/react-crud-app-without-and-with-redux-da4cd87f2eab
- https://reactresources.com/topics/state-management
- https://hackernoon.com/the-react-state-museum-a278c726315
- https://dev.to/deciduously/reactive-canvas-with-typescript-and-vue-1ne9
- https://blog.bitsrc.io/state-of-react-state-management-in-2019-779647206bbc
- https://www.freecodecamp.org/news/how-to-work-with-react-the-right-way-to-avoid-some-common-pitfalls-fc9eb5e34d9e/
- https://blog.discord.com/discord-react-memory-leak-565c89763e8
- https://www.leighhalliday.com/easy-mobx-redux-comparison
- https://www.sitepoint.com/redux-vs-mobx-which-is-best/
- https://www.robinwieruch.de/redux-mobx
- https://www.alonbd.com/blog/2019-10-09-why-you-should-use-mobx
- https://www.accelebrate.com/blog/state-management-mobx-versus-redux
- https://marmelab.com/blog/2018/06/27/redux-or-not-redux.html
- https://morioh.com/p/1094d6924d41
- https://levelup.gitconnected.com/react-crud-app-without-and-with-redux-da4cd87f2eab
- https://hackernoon.com/introducing-redux-offline-offline-first-architecture-for-progressive-web-applications-and-react-68c5167ecfe0
- https://alligator.io/vuejs/roundup-state-management-libraries/
- https://medium.com/@CKGrafico/does-your-next-project-need-flux-redux-vuex-mobx-or-not-ee54bb6c29a2
- https://nuxt.com/docs/bridge/overview
- https://vuex.vuejs.org/guide/migrating-to-4-0-from-3-x.html
- https://www.codementor.io/@petarvukasinovic/redux-vs-vuex-for-state-management-in-vue-js-n10yd7g2f
- https://dev.to/edrpls/migrating-a-large-flux-app-toredux-without-everything-falling-apart-133g
- https://www.npmjs.com/package/mobx-angularjs
- https://philhosoft.github.io/Programming/AngularJS-1-and-MobX-2/
- https://netbasal.com/managing-state-in-angular-with-mobx-51191803e14f
- https://medium.com/@vivainio/mobx-with-angular-part-2-patterns-perks-and-gotchas-37e2a393e0eb
- https://medium.com/terria/when-and-why-does-mobxs-keepalive-cause-a-memory-leak-8c29feb9ff55
- https://www.vuemastery.com/blog/migration/
- https://v3-migration.vuejs.org/breaking-changes/events-api.html
- https://pinia.vuejs.org/cookbook/options-api.html
- https://pinia.vuejs.org/ssr/nuxt.html#Nuxt-2-without-bridge
- https://blog.grossman.io/angular-1-using-redux-architecture/
- https://tech.webinterpret.com/why-we-decided-to-use-redux-in-our-angularjs-application/
- https://rangle.io/blog/managing-state-redux-angular/
- https://developers.soundcloud.com/blog/garbage-collection-in-redux-applications
- https://medium.com/@sherryhsu/making-async-calls-with-redux-thunk-2484b7be0bfa
- https://stackoverflow.com/questions/44493294/why-do-we-need-redux-thunk-when-we-already-have-mapdispatchtoprops
- https://medium.com/htc-research-engineering-blog/react-and-redux-notes-b6506cbc015a
- https://dev.to/mizchi/redux-workerized---redux-in-webworker-for-react-and-vue-13c9
- https://blog.bitsrc.io/using-react-redux-hooks-97654aff01e4
- https://thoughtbot.com/blog/using-redux-with-react-hooks
- https://medium.com/better-programming/using-hooks-to-replace-redux-392f98ca61b7
- https://mobx-react.js.org/observer-hook
- https://blog.logrocket.com/use-hooks-and-context-not-react-and-redux/
- https://itnext.io/using-react-hooks-with-canvas-f188d6e416c0
- https://levelup.gitconnected.com/using-the-indexeddb-api-with-react-and-hooks-4e63d83a5d1b
- https://vuex.vuejs.org/api/
- https://api.github.com/repos/vuejs/vuex/releases
- https://vuex.vuejs.org/api/
- https://docs.gitlab.com/ee/development/fe_guide/vuex.html
- https://cheatography.com/fortyseven/cheat-sheets/basic-vuex/
- https://tenmilesquare.com/understanding-mapgetters-in-vuex/
- https://stackoverflow.com/questions/59277092/how-to-use-mapgetters-with-vuex-modules
- https://github.com/vuejs/vuex/blob/dev/test/unit/helpers.spec.js
- https://alligator.io/vuejs/intro-to-vuex/
- https://gist.github.com/f-space/4f42e1f4b3542065ef84c91d97859a0e
- https://gist.github.com/wonderful-panda/46c072497f8731a2bde28da40e9ea2d7
- https://github.com/Raiondesu/tuex
- https://stackoverflow.com/questions/50236767/how-can-i-disable-vuex-getter-caching
- https://vuedose.tips/two-less-known-facts-about-vuex/
- https://github.com/vuejs/vuex/issues/1098
- https://github.com/vuejs/vuex/issues/24
- https://github.com/vuejs/vuex/issues/877
- https://stackoverflow.com/questions/48091687/how-exactly-does-the-spread-syntax-work-with-mapgetters
- https://stackoverflow.com/questions/45437585/vue-2-vuex-mapgetters-and-pass-params
- https://stackoverflow.com/questions/41833424/how-to-access-vuex-module-getters-and-mutations
- https://mobx-react.js.org/recipes-context#multiple-global-stores
- https://github.com/vuejs/vuex/issues/414
- https://blog.logrocket.com/managing-multiple-central-stores-with-vuex-74cc44646043/
- https://blogreact.com/indexeddb-with-react/
- https://github.com/HenrikJoreteg/redux-persist-middleware
- https://ui.toast.com/posts/en_20210413
- https://github.com/search?q=repo%3Avuejs%2Fpinia+proxy&type=code
- https://github.com/search?q=repo%3Avuejs%2Fvuex%20splice&type=code
- https://github.com/vuejs/docs/issues/849
import Vue from 'vue'; import { mount } from '@vue/test-utils'; import HelloWorld from './HelloWorld.vue'; Vue.config.silent = true; Vue.config.ignoredElements = ['nuxt-link']; Vue.config.stubs['nuxt-link'] = { template: '', }; Vue.config.stubs['no-ssr'] = { template: '', }; test('renders hello world', () => { const wrapper = mount(HelloWorld); expect(wrapper.text()).toBe('Hello World'); });