0.0.32 • Published 3 years ago

teras-core v0.0.32

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years 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

3 years ago

0.0.31

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.12

4 years ago

0.0.15-test02

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.15-test

4 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago