Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeliex/scrat
redux base framework support async/await
https://github.com/yeliex/scrat
Last synced: about 2 months ago
JSON representation
redux base framework support async/await
- Host: GitHub
- URL: https://github.com/yeliex/scrat
- Owner: yeliex
- License: mit
- Created: 2018-12-29T06:49:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T21:59:09.000Z (over 2 years ago)
- Last Synced: 2024-04-13T07:58:00.417Z (9 months ago)
- Language: TypeScript
- Size: 718 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scrat
redux base framework support async/await## Readme
scrat is a redux base framework that help use redux better in react (maybe vue.js as well in the future, who knows).## Features
- **Easy to learn, easy to use** explain redux simple, and make it easy to use
- **Async support** support async/await
- **Provide utils** provide many utils to extend effects(like pagination or progress)
- **Complicate with dva** fully complicate with dva.js, and do better
- **Focus on store** focus on store, use router framework you like(scrat don`t provide router instance)## WHY NOT DVA.JS
- Scrat support async/await, instead of generator
- Scrat provide many utils to extend effects
- Scrat focus on store implementation, it don`t provide router instance. Use any router framework you like
-Scrat support Vue.js(Maybe)## Installation
```bash
npm install @scrat/react --save
OR
yarn add @scrat/react
```## Usage
```javascript
import Store from '@scrat/react';const store = new Store();
Store.model({
namespaces: 'app',
state: {}, // initial state
reducer: {
dump(store, {title}){
return {
...store,
title,
}
}
},
effects: {
async setTitle({title}){
this.dump({
title
});
},
},
});(async () => {
await store.app.setTitle({
title: 'test page'
});
})();
```