0.0.32 • Published 1 year ago

teras-core v0.0.32

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

teras-core

npm version npm downloads Library minified size Library minified + gzipped size

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-core --save

or

yarn add teras-core

Usage

Init

import Teras, {Store} from 'teras-core';
import terasModel from "./models/terasModel";

Store.init({models: [terasModel]});

const {Provider} = Teras;

ReactDOM.render(
   <Provider store={Store.data}>
      <App />
   </Provider>,
  document.getElementById('root')
);

Models

const INITIAL_STATE = {
  initlabel: 'Hello World'
};

export default {
  namespace: 'terasModel',

  state: INITIAL_STATE,

  reducers: {},

  effects: {
  },
};

App

import Teras from 'teras-core';
const {connect} = Teras;

const mapStatesToProps = ({terasModel}) => ({
  terasModel,
});

function App({dispatch, terasModel}) {
  const {initlabel} = terasModel;

   return (
       <div>
        {initlabel}
      </div>
    );
}

export default connect(mapStateToProps)(App);

License

Copyright (C) 2021 Qumon Intelligence

Released under MIT License.

0.0.32

1 year ago

0.0.31

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.12

2 years ago

0.0.15-test02

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15-test

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago