1.1.98 • Published 6 years ago

redux-saga-wrappo v1.1.98

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

Redux-Saga-Wrappo

build status npm version npm downloads

npm install --save redux-saga-wrappo
yarn add redux-saga-wrappo

What is this?

This is a wrapper around Redux Saga, which enables you to

  1. Easily dispatch your actions
  2. Retrieve your reducers states easily in your components
  3. Dynamic component fetching.

Use Me ?

Probably yes, probably not :) This is actually a private project, created for our own usage. You can use it, but it will not have really proper documentation. We will try our best to work on this repo to improve it in the future.

Installation

npm install --save redux-saga-wrappo

Then, to enable Redux-Saga-Wrappo,

//Index.js
import React from "react";
import { ConnectedRouter } from "react-router-redux";
import { Route } from "react-router-dom";
import { appCreator, history } from "redux-saga-wrappo";

// App init
appCreator(
  <ConnectedRouter history={history}>
    <Route path="/" component={App} />
  </ConnectedRouter>,
  document.getElementById("root"),
  { rootSaga, rootReducer }
);

Sample Code

In Progress.

class Example extends PureComponent {
  componentWillMount = () => {
    const {
      exampleModel,
      userModel,
      authenticationSaga,
      exampleReducer
    } = this.props;
    exampleModel.updateState({ somethingNew: "new day" });
    exampleModel.removeState(["somethingNew"]);
    userModel.updateState({ name: "louis" });
    userModel.initializeAll();
    authenticationSaga.Login(1);
    authenticationSaga.getValidatePic();
    exampleReducer.Other_Reducer();
  };
  render() {
    const { exampleModel } = this.props;
    const { webUniqueCodea, webUniqueCodeb, somethingNew } = exampleModel;
    const { Default } = this.props.layouts;
    return (
      <Default>
        {JSON.stringify({ webUniqueCodea, webUniqueCodeb, somethingNew })}
      </Default>
    );
  }
}

const connectConfig = {
  mapActionToProps: { authenticationSaga, exampleReducer },
  mapStateToProps: ({ userModel, exampleModel }) => ({
    userModel,
    exampleModel
  })
};

export default getClientItem(["layouts"])(connect(connectConfig)(Example));

You can refer more on this boilerplate that I have prepared: (https://github.com/codedsphere/redux-saga-wrappo-boilerplate)

1.1.98

6 years ago

1.1.97

6 years ago

1.1.96

6 years ago

1.1.95

6 years ago

1.1.94

6 years ago

1.1.93

6 years ago

1.1.92

6 years ago

1.1.91

6 years ago

1.1.90

6 years ago

1.1.89

6 years ago

1.1.88

6 years ago

1.1.87

6 years ago

1.1.86

6 years ago

1.1.85

6 years ago

1.1.84

6 years ago

1.1.83

6 years ago

1.1.82

6 years ago

1.1.81

6 years ago

1.1.80

6 years ago

1.1.79

6 years ago

1.1.78

6 years ago

1.1.76

6 years ago

1.1.75

6 years ago

1.1.74

6 years ago

1.1.73

6 years ago

1.1.72

6 years ago

1.1.71

6 years ago

1.1.68

6 years ago

1.1.66

6 years ago

1.1.65

6 years ago

1.1.64

6 years ago

1.1.63

6 years ago

1.1.60

6 years ago

1.1.59

6 years ago

1.1.58

6 years ago

1.1.57

6 years ago

1.1.56

6 years ago

1.1.55

6 years ago

1.1.53

6 years ago

1.1.52

6 years ago

1.1.51

6 years ago

1.1.50

6 years ago

1.1.49

6 years ago

1.1.48

6 years ago

1.1.47

6 years ago

1.1.46

6 years ago

1.1.45

6 years ago

1.1.44

6 years ago

1.1.43

6 years ago

1.1.42

6 years ago

1.1.41

6 years ago

1.1.40

6 years ago

1.1.38

6 years ago

1.1.37

6 years ago

1.1.34

6 years ago

1.1.33

6 years ago

1.1.32

6 years ago

1.1.31

6 years ago

1.1.30

6 years ago

1.1.29

6 years ago

1.1.28

6 years ago

1.1.27

6 years ago

1.1.26

6 years ago

1.1.25

6 years ago

1.1.24

6 years ago

1.1.23

6 years ago

1.1.22

6 years ago

1.1.21

6 years ago

1.1.20

6 years ago

1.1.19

6 years ago

1.1.18

6 years ago

1.1.17

6 years ago

1.1.16

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago