Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woowabros/woowahan-action-player
woowahanjs action flow control middleware
https://github.com/woowabros/woowahan-action-player
Last synced: about 1 month ago
JSON representation
woowahanjs action flow control middleware
- Host: GitHub
- URL: https://github.com/woowabros/woowahan-action-player
- Owner: woowabros
- License: mit
- Created: 2017-07-19T05:25:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-24T01:06:33.000Z (about 6 years ago)
- Last Synced: 2024-11-17T15:55:23.860Z (about 1 month ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 30
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# woowahan-action-player
[![npm](https://img.shields.io/npm/v/woowahan-action-player.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/dm/woowahan-action-player.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/l/woowahan-action-player.svg?style=flat-square)]()Action flow control middleware for woowahanjs
#### requirements
* woowahanjs v0.3.0 higher
## Install
```
$ npm install --save-dev woowahan-action-player
```## Setup
```javascript
import Woowahan from 'woowahan';
import ActionPlayer from 'woowahan-action-player';const app = new Woowahan();
app.set(ActionPlayer);
```
## Use
```javascript
import Woowahan from 'woowahan';
import { FETCH_DATA1, FETCH_DATA2 } from './actions';export default Woowahan.View.create('myView', {
actions: {
fetchGroupName: {
immediate: false,
preventDupliateCall: true, // default false
sequence: true,
tasks: [
{
name: FETCH_DATA1,
params: {
type: 'xxid'
}
},
{
name: FETCH_DATA1,
/**
뷰의 메소드를 문자열 지정 방식도 지원
ex) params: 'buildParams',
**/
params(prev) {
let p = {};
p.subtype = prev.subtype;
return p;
}
}
],finish: 'fetchDataDone',
error(err) {
console.error(err);
}
},
},
fetchDataDone(results) {
console.log(results[FETCH_DATA1]);
console.log(results[FETCH_DATA2]);
},onSubmit() {
this.fetchGroupName();
}});
```