Socket
Socket
Sign inDemoInstall

react-int

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-int

React-Int(egrity)


Version published
Maintainers
1
Install size
31.2 kB
Created

Readme

Source

React-Int(egrity)

A simple way to use react with react-redux and redux-saga. Keep most things in one file(model) like Dva.

Feature

  • Reducers and sagas in one file.
  • Namespace.
  • Key as action type. (Convenient)
  • HMR everywhere. (Need extra code snippet)
  • Promisified dispatch.
  • Handles Effect errors without terminating app.
  • Works with create-react-app.

Feel free to make an issue or a pull request.

How it works

react-int is an encapsulation of react-redux and redux-saga, aiming to simplify code and related files. Its main job is to create store from models and render app.

Install

yarn add react-redux redux-saga react-int

# or 
npm i react-redux redux-saga react-int

Usage

Start app, write models and connect components. That's all. :tada:

// index.js
import start from "react-int";
import App from "./App";
import models from "./models";

const { updateApp, updateModels } = start(
  App,
  document.getElementById("root"),
  models,
  {/* options */},
);

// enable HMR
if (module.hot && process.env.NODE_ENV !== 'production') {
  module.hot.accept('./App', () => updateApp(App));
  module.hot.accept('./models', () => updateModels(models));
}

Data Flow

                                                      --Model-- 
       defines       triggers             sync       |         |   updates
State ----------> UI ----------> Actions ----------> | Reducer | ----------> Store
  ^                                 |                |         |               |
  |                                 |     async      |         |               |
  |                                 |--------------->|  Saga   |               |
  |                                 |<---------------|         |               |
  |                                       puts        ---------                |
  |                                                                            |
   ----------------------------------------------------------------------------
                                contains

Documentation

Basic introduction can be found on the website.

Refer to react, react-redux, redux-saga for further documentation.

Development

See Development.

Keywords

FAQs

Last updated on 10 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc