dott42npmtest
v0.2.17
Published
A light weight redux-saga wrapper
Downloads
2
Maintainers
Readme
Teras
Teras is a wrapper-library based on redux, redux-saga and react-router. (Inspired by dva-js)
Installation
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install teras --save
or
yarn add teras
Usage
Init
import Teras from 'teras';
import terasModel from "./models/terasModel";
ReactDOM.render(
<Teras models={[terasModel]}>
<App />
</Teras>
document.getElementById('root')
);
Models
const INITIAL_STATE = {
initlabel: 'Hello World'
};
export default {
namespace: 'terasModel',
state: INITIAL_STATE,
reducers: {},
effects: {
},
};
App
import {core} from 'teras';
const mapStatesToProps = ({terasModel}) => ({
terasModel,
});
function App({dispatch, terasModel}) {
const {initlabel} = terasModel;
return (
<div>
{initlabel}
</div>
);
}
export default core.connect(mapStateToProps)(App);
License
Copyright (C) 2021 Qumon Intelligence
Released under MIT License.