You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@cafebazaar/async-actions

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cafebazaar/async-actions - npm Package Compare versions

Comparing version
0.4.1
to
0.4.2
+92
CONTRIBUTING.md
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

+1
-1
{
"name": "@cafebazaar/async-actions",
"version": "0.4.1",
"version": "0.4.2",
"description": "",

@@ -5,0 +5,0 @@ "author": "Bazaar Front-End Chapter",

+35
-33

@@ -0,1 +1,5 @@

<p align="center">
<img src="https://user-images.githubusercontent.com/2771377/95751339-57fbe900-0cab-11eb-8eda-39d8e2807fca.png" />
</p>
## Overview

@@ -7,2 +11,4 @@

![Async Action Before/After Comparison](https://user-images.githubusercontent.com/2771377/96008074-0a6ab200-0e4c-11eb-8440-90026e4cf449.png)
## How It Works

@@ -39,26 +45,2 @@

### Pure JS
You can define an async-action using the `asyncAction` method, which gets a handler function and configuration options as its parameters. When using the pure version, you must provide an observable function which used for updating action properties.
```javascript
import { asyncAction } from '@cafebazaar/async-actions/pure';
import customObservable from 'utils/observable';
const myAsyncAction = asyncAction(
Promise.resolve('Hello'),
options,
customObservable
);
```
#### Options
| Property | Description | type | Required | Default |
| ----------- | ----------------------------------------------------------------------- | -------- | -------- | ------- |
| handler | action's handler | function | true | |
| immediate | determines handler function should be called immediately after creation | boolean | false | false |
| debounce | debounce time in milliseconds | number | false | 0 |
| initialData | the initial value of `data` property of action | any | false | null |
### Vue.js

@@ -136,2 +118,11 @@

#### Options
| Property | Description | type | Required | Default |
| ----------- | ----------------------------------------------------------------------- | -------- | -------- | ------- |
| handler | action's handler | function | true | |
| immediate | determines handler function should be called immediately after creation | boolean | false | false |
| debounce | debounce time in miliseconds | number | false | 0 |
| initialData | initial value of `data` property of action | any | false | null |
#### 2. Create asyncActions outside of components

@@ -210,11 +201,5 @@

<ul>
<li>
Status: {$state}
</li>
<li>
Data: {$data}
</li>
<li>
Error: {$error}
</li>
<li>Status: {$state}</li>
<li>Data: {$data}</li>
<li>Error: {$error}</li>
</ul>

@@ -228,4 +213,21 @@ </main>

### Pure JS
You can define an async-action using `asyncAction` method which gets a handler function and configuration options as its parameters. When using the pure version, you must provide an observable function which used for updating action properties.
```javascript
import { asyncAction } from '@cafebazaar/async-actions/pure';
import customObservable from 'utils/observable';
const myAsyncAction = asyncAction(
Promise.resolve('Hello'),
options,
customObservable
);
```
List of all options are available [here](#options).
## License
[MIT](https://github.com/cafebazaar/async-actions/blob/master/LICENSE)

Sorry, the diff of this file is not supported yet

function t(){return(t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function e(t,e,r){var n,i=void 0===e?{}:e,o=i.initialData,a=void 0===o?null:o,u=i.debounce,c=void 0===u?0:u,l=i.immediate,s=void 0!==l&&l,f=i.ctx,d=void 0===f?null:f;if(c&&(!("number"==typeof(n=c)&&!Number.isNaN(n)||n instanceof Number)||c<0))throw new Error("debounce option must be a positive number");var p=r({state:"notInitiated",data:a,error:null}),v=function(){return p.state="pending",p.error=null,p.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return p.state="fulfilled",p.data=t,t}).catch(function(t){throw p.state="rejected",p.error=t,t})};return c&&(v=function(t,e){var r;return function(){r&&clearTimeout(r),r=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(v,c)),Object.defineProperties(v,{state:{get:function(){return p.state}},error:{get:function(){return p.error}},data:{get:function(){return p.data}}}),s&&v.call(this),v}function r(r,n){return function(i,o){return e(i,t({},r,o),n)}}export{e as asyncAction,r as asyncActionCreator};
function t(){return(t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function e(t,e,n){var r,o=void 0===e?{}:e,i=o.initialData,a=void 0===i?null:i,u=o.debounce,c=void 0===u?0:u,l=o.immediate,s=void 0!==l&&l,f=o.ctx,d=void 0===f?null:f;if(c&&(!("number"==typeof(r=c)&&!Number.isNaN(r)||r instanceof Number)||c<0))throw new Error("debounce option must be a positive number");var p=n({state:"notInitiated",data:a,error:null}),v=function(){return p.state="pending",p.error=null,p.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return p.state="fulfilled",p.data=t,t}).catch(function(t){throw p.state="rejected",p.error=t,t})};return c&&(v=function(t,e){var n;return function(){n&&clearTimeout(n),n=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(v,c)),Object.defineProperties(v,{state:{get:function(){return p.state}},error:{get:function(){return p.error}},data:{get:function(){return p.data}}}),s&&v.call(this),v}exports.asyncAction=e,exports.asyncActionCreator=function(n,r){return function(o,i){return e(o,t({},n,i),r)}};
function t(t,{initialData:e=null,debounce:r=0,immediate:n=!1,ctx:a=null}={},i){if(r&&(!("number"==typeof(o=r)&&!Number.isNaN(o)||o instanceof Number)||r<0))throw new Error("debounce option must be a positive number");var o;const u=i({state:"notInitiated",data:e,error:null});let l=function(...e){return u.state="pending",u.error=null,u.data=null,Promise.resolve(t.apply(a||this,e)).then(t=>(u.state="fulfilled",u.data=t,t)).catch(t=>{throw u.state="rejected",u.error=t,t})};return r&&(l=function(t,e){let r;return function(...n){r&&clearTimeout(r),r=setTimeout(t.bind(this,...n),e)}}(l,r)),Object.defineProperties(l,{state:{get:()=>u.state},error:{get:()=>u.error},data:{get:()=>u.data}}),n&&l.call(this),l}function e(e,r){return(n,a)=>t(n,{...e,...a},r)}export{t as asyncAction,e as asyncActionCreator};
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["async-actions"]={})}(this,function(t){function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function n(t,e,n){var r,o=void 0===e?{}:e,i=o.initialData,a=void 0===i?null:i,u=o.debounce,c=void 0===u?0:u,f=o.immediate,l=void 0!==f&&f,s=o.ctx,d=void 0===s?null:s;if(c&&(!("number"==typeof(r=c)&&!Number.isNaN(r)||r instanceof Number)||c<0))throw new Error("debounce option must be a positive number");var p=n({state:"notInitiated",data:a,error:null}),v=function(){return p.state="pending",p.error=null,p.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return p.state="fulfilled",p.data=t,t}).catch(function(t){throw p.state="rejected",p.error=t,t})};return c&&(v=function(t,e){var n;return function(){n&&clearTimeout(n),n=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(v,c)),Object.defineProperties(v,{state:{get:function(){return p.state}},error:{get:function(){return p.error}},data:{get:function(){return p.data}}}),l&&v.call(this),v}t.asyncAction=n,t.asyncActionCreator=function(t,r){return function(o,i){return n(o,e({},t,i),r)}}});
import{writable as t}from"svelte/store";export default function(e,n){return function(e,n,r){var i,o=void 0===n?{}:n,u=o.initialData,a=void 0===u?null:u,c=o.debounce,l=void 0===c?0:c,f=o.immediate,s=void 0!==f&&f,d=o.ctx,p=void 0===d?null:d;if(l&&(!("number"==typeof(i=l)&&!Number.isNaN(i)||i instanceof Number)||l<0))throw new Error("debounce option must be a positive number");var v=function(e){var n={};return Object.keys(e).forEach(function(r){var i=t(e[r]);Object.defineProperty(n,r,{get:function(){return i},set:function(t){i.update(function(){return t})}})}),n}({state:"notInitiated",data:a,error:null}),m=function(){return v.state="pending",v.error=null,v.data=null,Promise.resolve(e.apply(p||this,[].slice.call(arguments))).then(function(t){return v.state="fulfilled",v.data=t,t}).catch(function(t){throw v.state="rejected",v.error=t,t})};return l&&(m=function(t,e){var n;return function(){n&&clearTimeout(n),n=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(m,l)),Object.defineProperties(m,{state:{get:function(){return v.state}},error:{get:function(){return v.error}},data:{get:function(){return v.data}}}),s&&m.call(this),m}(e,n)}
var t=require("svelte/store");module.exports=function(e,r){return function(e,r,n){var i,o=void 0===r?{}:r,u=o.initialData,a=void 0===u?null:u,c=o.debounce,l=void 0===c?0:c,s=o.immediate,f=void 0!==s&&s,d=o.ctx,v=void 0===d?null:d;if(l&&(!("number"==typeof(i=l)&&!Number.isNaN(i)||i instanceof Number)||l<0))throw new Error("debounce option must be a positive number");var b=function(e){var r={};return Object.keys(e).forEach(function(n){var i=t.writable(e[n]);Object.defineProperty(r,n,{get:function(){return i},set:function(t){i.update(function(){return t})}})}),r}({state:"notInitiated",data:a,error:null}),p=function(){return b.state="pending",b.error=null,b.data=null,Promise.resolve(e.apply(v||this,[].slice.call(arguments))).then(function(t){return b.state="fulfilled",b.data=t,t}).catch(function(t){throw b.state="rejected",b.error=t,t})};return l&&(p=function(t,e){var r;return function(){r&&clearTimeout(r),r=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(p,l)),Object.defineProperties(p,{state:{get:function(){return b.state}},error:{get:function(){return b.error}},data:{get:function(){return b.data}}}),f&&p.call(this),p}(e,r)};
import{writable as t}from"svelte/store";export default function(e,r){return function(t,{initialData:e=null,debounce:r=0,immediate:n=!1,ctx:o=null}={},a){if(r&&(!("number"==typeof(i=r)&&!Number.isNaN(i)||i instanceof Number)||r<0))throw new Error("debounce option must be a positive number");var i;const u=a({state:"notInitiated",data:e,error:null});let s=function(...e){return u.state="pending",u.error=null,u.data=null,Promise.resolve(t.apply(o||this,e)).then(t=>(u.state="fulfilled",u.data=t,t)).catch(t=>{throw u.state="rejected",u.error=t,t})};return r&&(s=function(t,e){let r;return function(...n){r&&clearTimeout(r),r=setTimeout(t.bind(this,...n),e)}}(s,r)),Object.defineProperties(s,{state:{get:()=>u.state},error:{get:()=>u.error},data:{get:()=>u.data}}),n&&s.call(this),s}(e,r,e=>{const r={};return Object.keys(e).forEach(n=>{const o=t(e[n]);Object.defineProperty(r,n,{get:()=>o,set(t){o.update(()=>t)}})}),r})}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("svelte/store")):"function"==typeof define&&define.amd?define(["svelte/store"],t):(e=e||self)["async-actions"]=t(e.store)}(this,function(e){return function(t,n){return function(t,n,r){var o,i=void 0===n?{}:n,u=i.initialData,a=void 0===u?null:u,c=i.debounce,f=void 0===c?0:c,l=i.immediate,s=void 0!==l&&l,d=i.ctx,p=void 0===d?null:d;if(f&&(!("number"==typeof(o=f)&&!Number.isNaN(o)||o instanceof Number)||f<0))throw new Error("debounce option must be a positive number");var v=function(t){var n={};return Object.keys(t).forEach(function(r){var o=e.writable(t[r]);Object.defineProperty(n,r,{get:function(){return o},set:function(e){o.update(function(){return e})}})}),n}({state:"notInitiated",data:a,error:null}),b=function(){return v.state="pending",v.error=null,v.data=null,Promise.resolve(t.apply(p||this,[].slice.call(arguments))).then(function(e){return v.state="fulfilled",v.data=e,e}).catch(function(e){throw v.state="rejected",v.error=e,e})};return f&&(b=function(e,t){var n;return function(){n&&clearTimeout(n),n=setTimeout(e.bind.apply(e,[this].concat([].slice.call(arguments))),t)}}(b,f)),Object.defineProperties(b,{state:{get:function(){return v.state}},error:{get:function(){return v.error}},data:{get:function(){return v.data}}}),s&&b.call(this),b}(t,n)}});
import t from"vue";function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}).apply(this,arguments)}function e(t){return t&&"[object Function]"==={}.toString.call(t)}function r(n,e){return function(t,n,e){var r,o=void 0===n?{}:n,i=o.initialData,a=void 0===i?null:i,c=o.debounce,u=void 0===c?0:c,l=o.immediate,s=void 0!==l&&l,f=o.ctx,d=void 0===f?null:f;if(u&&(!("number"==typeof(r=u)&&!Number.isNaN(r)||r instanceof Number)||u<0))throw new Error("debounce option must be a positive number");var p=e({state:"notInitiated",data:a,error:null}),v=function(){return p.state="pending",p.error=null,p.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return p.state="fulfilled",p.data=t,t}).catch(function(t){throw p.state="rejected",p.error=t,t})};return u&&(v=function(t,n){var e;return function(){e&&clearTimeout(e),e=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),n)}}(v,u)),Object.defineProperties(v,{state:{get:function(){return p.state}},error:{get:function(){return p.error}},data:{get:function(){return p.data}}}),s&&v.call(this),v}(n,e,t.observable)}var o={install:function(t){t.mixin({beforeCreate:function(){var t=this;this.$options.asyncActions&&Object.keys(this.$options.asyncActions).forEach(function(o){var i=t.$options.asyncActions[o];if(e(i))t[o]=r(i,{ctx:t});else{var a=i.handler,c=function(t,n){if(null==t)return{};var e,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n.indexOf(e=i[r])>=0||(o[e]=t[e]);return o}(i,["handler"]);if(!e(a))throw new Error("handler must be a function");t[o]=r(a,n({ctx:t},c))}})}})}};export default o;export{r as asyncAction};
var t,n=(t=require("vue"))&&"object"==typeof t&&"default"in t?t.default:t;function e(){return(e=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}).apply(this,arguments)}function r(t){return t&&"[object Function]"==={}.toString.call(t)}function i(t,e){return function(t,n,e){var r,i=void 0===n?{}:n,o=i.initialData,a=void 0===o?null:o,c=i.debounce,u=void 0===c?0:c,l=i.immediate,s=void 0!==l&&l,f=i.ctx,d=void 0===f?null:f;if(u&&(!("number"==typeof(r=u)&&!Number.isNaN(r)||r instanceof Number)||u<0))throw new Error("debounce option must be a positive number");var v=e({state:"notInitiated",data:a,error:null}),p=function(){return v.state="pending",v.error=null,v.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return v.state="fulfilled",v.data=t,t}).catch(function(t){throw v.state="rejected",v.error=t,t})};return u&&(p=function(t,n){var e;return function(){e&&clearTimeout(e),e=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),n)}}(p,u)),Object.defineProperties(p,{state:{get:function(){return v.state}},error:{get:function(){return v.error}},data:{get:function(){return v.data}}}),s&&p.call(this),p}(t,e,n.observable)}var o={install:function(t){t.mixin({beforeCreate:function(){var t=this;this.$options.asyncActions&&Object.keys(this.$options.asyncActions).forEach(function(n){var o=t.$options.asyncActions[n];if(r(o))t[n]=i(o,{ctx:t});else{var a=o.handler,c=function(t,n){if(null==t)return{};var e,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n.indexOf(e=o[r])>=0||(i[e]=t[e]);return i}(o,["handler"]);if(!r(a))throw new Error("handler must be a function");t[n]=i(a,e({ctx:t},c))}})}})}};exports.asyncAction=i,exports.default=o;
import t from"vue";function e(t){return t&&"[object Function]"==={}.toString.call(t)}function n(e,n){return function(t,{initialData:e=null,debounce:n=0,immediate:r=!1,ctx:i=null}={},o){if(n&&(!("number"==typeof(a=n)&&!Number.isNaN(a)||a instanceof Number)||n<0))throw new Error("debounce option must be a positive number");var a;const s=o({state:"notInitiated",data:e,error:null});let c=function(...e){return s.state="pending",s.error=null,s.data=null,Promise.resolve(t.apply(i||this,e)).then(t=>(s.state="fulfilled",s.data=t,t)).catch(t=>{throw s.state="rejected",s.error=t,t})};return n&&(c=function(t,e){let n;return function(...r){n&&clearTimeout(n),n=setTimeout(t.bind(this,...r),e)}}(c,n)),Object.defineProperties(c,{state:{get:()=>s.state},error:{get:()=>s.error},data:{get:()=>s.data}}),r&&c.call(this),c}(e,n,t.observable)}var r={install(t){t.mixin({beforeCreate(){this.$options.asyncActions&&Object.keys(this.$options.asyncActions).forEach(t=>{const r=this.$options.asyncActions[t];if(e(r))this[t]=n(r,{ctx:this});else{const{handler:i,...o}=r;if(!e(i))throw new Error("handler must be a function");this[t]=n(i,{ctx:this,...o})}})}})}};export default r;export{n as asyncAction};
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e((t=t||self)["async-actions"]={},t.vue)}(this,function(t,e){function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function r(t){return t&&"[object Function]"==={}.toString.call(t)}function o(t,n){return function(t,e,n){var r,o=void 0===e?{}:e,i=o.initialData,a=void 0===i?null:i,c=o.debounce,u=void 0===c?0:c,s=o.immediate,l=void 0!==s&&s,f=o.ctx,d=void 0===f?null:f;if(u&&(!("number"==typeof(r=u)&&!Number.isNaN(r)||r instanceof Number)||u<0))throw new Error("debounce option must be a positive number");var p=n({state:"notInitiated",data:a,error:null}),v=function(){return p.state="pending",p.error=null,p.data=null,Promise.resolve(t.apply(d||this,[].slice.call(arguments))).then(function(t){return p.state="fulfilled",p.data=t,t}).catch(function(t){throw p.state="rejected",p.error=t,t})};return u&&(v=function(t,e){var n;return function(){n&&clearTimeout(n),n=setTimeout(t.bind.apply(t,[this].concat([].slice.call(arguments))),e)}}(v,u)),Object.defineProperties(v,{state:{get:function(){return p.state}},error:{get:function(){return p.error}},data:{get:function(){return p.data}}}),l&&v.call(this),v}(t,n,e.observable)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var i={install:function(t){t.mixin({beforeCreate:function(){var t=this;this.$options.asyncActions&&Object.keys(this.$options.asyncActions).forEach(function(e){var i=t.$options.asyncActions[e];if(r(i))t[e]=o(i,{ctx:t});else{var a=i.handler,c=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}(i,["handler"]);if(!r(a))throw new Error("handler must be a function");t[e]=o(a,n({ctx:t},c))}})}})}};t.asyncAction=o,t.default=i});