You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple plugin for Vue.js 2.6.x, offering a clean way to keep the state of your application inside your components.
8
9
@@ -14,6 +15,19 @@ Why?
14
15
1. Vuex is centralized by design, but suggests dividing the store into modules to mimic the application's structure. This usually requires a lot of boilerplate. It's easier to use the existing component hierarchy and Vue's reactivity system directly instead.
15
16
2. Vue has a `provide`/`inject` mechanism for passing data down the component hierarchy without chains of props, but [it's not reactive by default](https://github.com/vuejs/vue/issues/7017).
function_createForOfIteratorHelper(o,allowArrayLike){varit=typeofSymbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeofo.length==="number"){if(it)o=it;vari=0;varF=functionF(){};return{s: F,n: functionn(){if(i>=o.length)return{done: true};return{done: false,value: o[i++]};},e: functione(_e2){throw_e2;},f: F};}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}varnormalCompletion=true,didErr=false,err;return{s: functions(){it=it.call(o);},n: functionn(){varstep=it.next();normalCompletion=step.done;returnstep;},e: functione(_e3){didErr=true;err=_e3;},f: functionf(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throwerr;}}};}
function_nonIterableRest(){thrownewTypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
// Idea for provide/inject reactivity taken from https://github.com/vuejs/vue/issues/7017#issuecomment-480906691.
29
+
// Implementation details for options merging borrowed from https://github.com/LinusBorg/vue-reactive-provide/.
30
+
// Note: the merge function for `inject` seems to work only with object-based definitions, even though simple lists with names to inject would suffice here.
0 commit comments