Skip to content

Instantly share code, notes, and snippets.

@iDevelopThings
Created January 24, 2021 10:10
Show Gist options
  • Save iDevelopThings/548c2c528d6aafd8dc13299bca99917d to your computer and use it in GitHub Desktop.
Save iDevelopThings/548c2c528d6aafd8dc13299bca99917d to your computer and use it in GitHub Desktop.
VueJS Observable State
import Vue from 'vue';
class SomeState {
constructor()
{
this.state = Vue.observable({});
}
}
export { SomeState };
export default new SomeState();
//In app.js where you initiate vue.
import SomeState from '....SomeState';
Vue.prototype.$someState = SomeState;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment