Comparing version 2.0.0-alpha.14 to 2.0.0-alpha.15
@@ -0,1 +1,7 @@ | ||
# [2.0.0-alpha.15](https://github.com/posva/pinia/compare/v2.0.0-alpha.14...v2.0.0-alpha.15) (2021-05-04) | ||
### Bug Fixes | ||
- **devtools:** fix devtools attach ([017795a](https://github.com/posva/pinia/commit/017795aac3e654d6c67f99437851dcfe589d20b0)) | ||
# [2.0.0-alpha.14](https://github.com/posva/pinia/compare/v2.0.0-alpha.13...v2.0.0-alpha.14) (2021-05-03) | ||
@@ -2,0 +8,0 @@ |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
@@ -4,0 +4,0 @@ * @license MIT |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
@@ -4,0 +4,0 @@ * @license MIT |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
@@ -44,3 +44,11 @@ * @license MIT | ||
let resolveApp; | ||
const setClientApp = (app) => resolveApp && resolveApp(app); | ||
const setClientApp = (app) => { | ||
if (resolveApp) { | ||
resolveApp(app); | ||
} | ||
else { | ||
// setClientApp might be called before getClientApp | ||
clientAppPromise = Promise.resolve(app); | ||
} | ||
}; | ||
const getClientApp = () => clientAppPromise || | ||
@@ -47,0 +55,0 @@ (clientAppPromise = new Promise((resolve) => (resolveApp = resolve))); |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
@@ -44,3 +44,11 @@ * @license MIT | ||
let resolveApp; | ||
const setClientApp = (app) => resolveApp && resolveApp(app); | ||
const setClientApp = (app) => { | ||
if (resolveApp) { | ||
resolveApp(app); | ||
} | ||
else { | ||
// setClientApp might be called before getClientApp | ||
clientAppPromise = Promise.resolve(app); | ||
} | ||
}; | ||
const getClientApp = () => clientAppPromise || | ||
@@ -47,0 +55,0 @@ (clientAppPromise = new Promise((resolve) => (resolveApp = resolve))); |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
@@ -45,3 +45,11 @@ * @license MIT | ||
let resolveApp; | ||
const setClientApp = (app) => resolveApp && resolveApp(app); | ||
const setClientApp = (app) => { | ||
if (resolveApp) { | ||
resolveApp(app); | ||
} | ||
else { | ||
// setClientApp might be called before getClientApp | ||
clientAppPromise = Promise.resolve(app); | ||
} | ||
}; | ||
const getClientApp = () => clientAppPromise || | ||
@@ -48,0 +56,0 @@ (clientAppPromise = new Promise((resolve) => (resolveApp = resolve))); |
/*! | ||
* pinia v2.0.0-alpha.14 | ||
* pinia v2.0.0-alpha.15 | ||
* (c) 2021 Eduardo San Martin Morote | ||
* @license MIT | ||
*/ | ||
var Pinia=function(t,e){"use strict";const n="undefined"!=typeof window;let r;const o=t=>r=t,s=()=>r,c=new WeakMap;let i;const u=Symbol();function a(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}function f(t,e){for(const n in e){const r=e[n],o=t[n];t[n]=a(o)&&a(r)?f(o,r):r}return t}const{assign:p}=Object;function l(t,n=(()=>({})),r){const o=s();o.state.value[t]=r||n();let c=!0,i=[];return[{$id:t,_p:o,$patch:function(e){let n,r={};c=!1,"function"==typeof e?(e(o.state.value[t]),n="๐งฉ patch"):(f(o.state.value[t],e),r=e,n="โคต๏ธ patch"),c=!0,i.forEach(e=>{e({storeName:t,type:n,payload:r},o.state.value[t])})},$subscribe:function(n){i.push(n);const r=e.watch(()=>o.state.value[t],e=>{c&&n({storeName:t,type:"๐งฉ in place",payload:{}},e)},{deep:!0,flush:"sync"}),s=()=>{const t=i.indexOf(n);t>-1&&(i.splice(t,1),r())};return e.getCurrentInstance()&&e.onUnmounted(s),s},$reset:function(){o.state.value[t]=n()}},{get:()=>o.state.value[t],set:e=>{c=!1,o.state.value[t]=e,c=!0}},Symbol()]}function d(t,n,r,c={},i={},u){const a=s(),f={};for(const t in c)f[t]=e.computed(()=>(o(a),c[t].call(d,d)));const l={};for(const t in i)l[t]=function(){return o(a),i[t].apply(d,arguments)};const d=e.reactive(p({},t,function(t,n){const r={},o=t.value[n];for(const s in o)r[s]=e.computed({get:()=>t.value[n][s],set:e=>t.value[n][s]=e});return r}(a.state,r),f,l));return Object.defineProperty(d,"$state",n),a._p.forEach(t=>{p(d,t({store:d,app:a._a,pinia:a,options:u}))}),d}function h(t){const{id:n,state:r,getters:i,actions:a}=t;function f(f){const p=e.getCurrentInstance(),h=p&&!f;(f=f||p&&e.inject(u))&&o(f),f=s();let y=c.get(f);y||c.set(f,y=new Map);let b=y.get(n);if(!b){b=l(n,r,f.state.value[n]),y.set(n,b);const o=d(b[0],b[1],n,i,a,t);return h&&e.provide(b[2],o),o}return p&&e.inject(b[2],null)||d(b[0],b[1],n,i,a,t)}return f.$id=n,f}function y(t,e){const n="_pStores"in t?t._pStores:t._pStores={},r=e.$id;return n[r]||(n[r]=e(t.$pinia))}let b="Store";function v(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]=function(){return y(this,t)[n]},e),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const n=y(this,t),o=e[r];return"function"==typeof o?o.call(this,n):n[o]},n),{})}const S=v;return t.createPinia=function(){const t=e.ref({});let r,s=[];const c=[],a={install(t){a._a=r=t,t.provide(u,a),t.config.globalProperties.$pinia=a,n&&((t=>{i&&i(t)})(t),o(a)),c.forEach(t=>s.push(t))},use(t){return r?s.push(t):c.push(t),this},_p:s,_a:r,state:t};return a},t.createStore=t=>(console.warn('[๐]: "createStore" has been deprecated and will be removed on the sable release, use "defineStore" instead.'),h(t)),t.defineStore=h,t.mapActions=function(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]=function(...e){return y(this,t)[n](...e)},e),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(...n){return y(this,t)[e[r]](...n)},n),{})},t.mapGetters=S,t.mapState=v,t.mapStores=function(...t){return t.reduce((t,e)=>(t[e.$id+b]=function(){return y(this,e)},t),{})},t.mapWritableState=function(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]={get(){return y(this,t)[n]},set(e){return y(this,t)[n]=e}},e),{}):Object.keys(e).reduce((n,r)=>(n[r]={get(){return y(this,t)[e[r]]},set(n){return y(this,t)[e[r]]=n}},n),{})},t.setActivePinia=o,t.setMapStoreSuffix=function(t){b=t},Object.defineProperty(t,"__esModule",{value:!0}),t}({},Vue); | ||
var Pinia=function(t,e){"use strict";const n="undefined"!=typeof window;let r;const o=t=>r=t,s=()=>r,c=new WeakMap;let i,u;const a=Symbol();function f(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}function p(t,e){for(const n in e){const r=e[n],o=t[n];t[n]=f(o)&&f(r)?p(o,r):r}return t}const{assign:l}=Object;function d(t,n=(()=>({})),r){const o=s();o.state.value[t]=r||n();let c=!0,i=[];return[{$id:t,_p:o,$patch:function(e){let n,r={};c=!1,"function"==typeof e?(e(o.state.value[t]),n="๐งฉ patch"):(p(o.state.value[t],e),r=e,n="โคต๏ธ patch"),c=!0,i.forEach(e=>{e({storeName:t,type:n,payload:r},o.state.value[t])})},$subscribe:function(n){i.push(n);const r=e.watch(()=>o.state.value[t],e=>{c&&n({storeName:t,type:"๐งฉ in place",payload:{}},e)},{deep:!0,flush:"sync"}),s=()=>{const t=i.indexOf(n);t>-1&&(i.splice(t,1),r())};return e.getCurrentInstance()&&e.onUnmounted(s),s},$reset:function(){o.state.value[t]=n()}},{get:()=>o.state.value[t],set:e=>{c=!1,o.state.value[t]=e,c=!0}},Symbol()]}function h(t,n,r,c={},i={},u){const a=s(),f={};for(const t in c)f[t]=e.computed(()=>(o(a),c[t].call(d,d)));const p={};for(const t in i)p[t]=function(){return o(a),i[t].apply(d,arguments)};const d=e.reactive(l({},t,function(t,n){const r={},o=t.value[n];for(const s in o)r[s]=e.computed({get:()=>t.value[n][s],set:e=>t.value[n][s]=e});return r}(a.state,r),f,p));return Object.defineProperty(d,"$state",n),a._p.forEach(t=>{l(d,t({store:d,app:a._a,pinia:a,options:u}))}),d}function y(t){const{id:n,state:r,getters:i,actions:u}=t;function f(f){const p=e.getCurrentInstance(),l=p&&!f;(f=f||p&&e.inject(a))&&o(f),f=s();let y=c.get(f);y||c.set(f,y=new Map);let v=y.get(n);if(!v){v=d(n,r,f.state.value[n]),y.set(n,v);const o=h(v[0],v[1],n,i,u,t);return l&&e.provide(v[2],o),o}return p&&e.inject(v[2],null)||h(v[0],v[1],n,i,u,t)}return f.$id=n,f}function v(t,e){const n="_pStores"in t?t._pStores:t._pStores={},r=e.$id;return n[r]||(n[r]=e(t.$pinia))}let b="Store";function S(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]=function(){return v(this,t)[n]},e),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(){const n=v(this,t),o=e[r];return"function"==typeof o?o.call(this,n):n[o]},n),{})}const m=S;return t.createPinia=function(){const t=e.ref({});let r,s=[];const c=[],f={install(t){f._a=r=t,t.provide(a,f),t.config.globalProperties.$pinia=f,n&&((t=>{u?u(t):i=Promise.resolve(t)})(t),o(f)),c.forEach(t=>s.push(t))},use(t){return r?s.push(t):c.push(t),this},_p:s,_a:r,state:t};return f},t.createStore=t=>(console.warn('[๐]: "createStore" has been deprecated and will be removed on the sable release, use "defineStore" instead.'),y(t)),t.defineStore=y,t.mapActions=function(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]=function(...e){return v(this,t)[n](...e)},e),{}):Object.keys(e).reduce((n,r)=>(n[r]=function(...n){return v(this,t)[e[r]](...n)},n),{})},t.mapGetters=m,t.mapState=S,t.mapStores=function(...t){return t.reduce((t,e)=>(t[e.$id+b]=function(){return v(this,e)},t),{})},t.mapWritableState=function(t,e){return Array.isArray(e)?e.reduce((e,n)=>(e[n]={get(){return v(this,t)[n]},set(e){return v(this,t)[n]=e}},e),{}):Object.keys(e).reduce((n,r)=>(n[r]={get(){return v(this,t)[e[r]]},set(n){return v(this,t)[e[r]]=n}},n),{})},t.setActivePinia=o,t.setMapStoreSuffix=function(t){b=t},Object.defineProperty(t,"__esModule",{value:!0}),t}({},Vue); |
{ | ||
"name": "pinia", | ||
"version": "2.0.0-alpha.14", | ||
"version": "2.0.0-alpha.15", | ||
"description": "Intuitive, type safe and flexible Store for Vue", | ||
@@ -5,0 +5,0 @@ "main": "dist/pinia.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156052
3714