@zcorky/soul
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

soul

NPM version Coverage Status Dependencies Build Status license issues

Give a soul for your app.

Install

$ npm install @zcorky/soul

Usage

import soul from '@zcorky/soul';

const app = new Soul();

app.model({
	namespace: 'user',
	state: {
		total: 1,
		current: 12138,
		list: [{
			id: 12138,
			name: 'zero',
		}],
	},
	reducers: {
		save(state, { payload }) {
			const { total, list } = payload;
			return {
				...state,
				total,
				list,
			};
		},
	},
	effects: {
		async 'sync'(action, { put }) {
			const { total, user } = await syncUserService();
			await put({ type: 'user/save', payload: { total, user } });
		},
	},
});

app.start();

Readme

Keywords

none

Package Sidebar

Install

npm i @zcorky/soul

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

32.9 kB

Total Files

23

Last publish

Collaborators

  • uniquecolesmith