# no-redux

> A react/redux library which automates all redux flows including http calls, and store immutability is guaranteed. Redux becomes invisible to you, hence the name no-redux.

Latest version **0.5.0** (published 2018-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install no-redux
pnpm add no-redux
yarn add no-redux
bun add no-redux
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2018-06-01 |
| First published | 2017-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 78.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nan Li |
| Maintainers | ln613 |
| Keywords | javascript, react, redux, ramda, immutable, redux-cycles, cyclejs, http-requests, reselect |

## Links

- npm: https://www.npmjs.com/package/no-redux
- Repository: https://github.com/ln613/no-redux
- Homepage: https://github.com/ln613/no-redux#readme
- Issues: https://github.com/ln613/no-redux/issues
- npm.io page: https://npm.io/package/no-redux

## Dependencies (6)

- [ipath](https://npm.io/package/ipath.md) ^0.1.0
- [ramda](https://npm.io/package/ramda.md) ^0.25.0
- [redux](https://npm.io/package/redux.md) ^3.7.2
- [@cycle/http](https://npm.io/package/@cycle/http.md) ^14.7.0
- [react-redux](https://npm.io/package/react-redux.md) ^5.0.6
- [redux-cycles](https://npm.io/package/redux-cycles.md) ^0.4.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2018-06-01
- 0.4.0 — 2018-05-16
- 0.3.0 — 2017-12-20
- 0.2.3 — 2017-12-03
- 0.2.2 — 2017-11-30
- 0.2.1 — 2017-11-24
- 0.2.0 — 2017-11-16
- 0.1.1 — 2017-11-08
- 0.1.0 — 2017-11-05

## README

# no-redux

[![Build Status](https://travis-ci.org/ln613/no-redux.svg?branch=master)](https://travis-ci.org/ln613/no-redux)

A react/redux library which automates all redux flows including http calls, and store immutability is guaranteed. Redux becomes invisible to you, hence the name no-redux.

|   | redux | no-redux |
|---|---|---|
| define action type | manual | manual |
| generate action creator | manual | auto |
| call action creator in components | ‎manual | manual |
| handle action in middleware (thunk/saga...) | ‎manual | auto |
| send http request | ‎manual | auto |
| receive http response | ‎manual | auto |
| handle action in reducer | manual | auto |
| ensure store immutability | ‎manual | auto |

[slides and demo](https://ln613.github.io/no-redux)

[todo example](https://ln613.github.io/no-redux-todo-example)

[documetation](https://ln613.gitbooks.io/no-redux/)
## Install

`npm i -S no-redux`

## Usage

**Step 1**

Define an action data object, and call "generateActions" to generate action creators.

```js
import { generateActions } from 'no-redux';

export const actionData = {
  artists: {
    url: 'http://localhost/api/artists'
  }
}

export default generateActions(actionData);
```

**Step 2**

Create a redux store by calling the "createStore" function from "no-redux" with the action data object you defined in step 1. The "createStore" function will generate reducers and middlewares that handle http calls and register them with the store.

```js
import React from 'react';
import { render } from 'react-dom';
import { Provider, createStore } from 'no-redux';
import { actionData } from './actions';
import App from './App';

render(
  <Provider store={createStore(actionData)}>
    <App />  
  </Provider>,
  document.getElementById('root')
);
```

**Step 3**

In your component, connect to the store with the action creators you created in step 1. When you call the action creator functions, no-redux will make http requests, get the http response and put the results on the redux store.

```js
import React from 'react';
import { connect } from 'no-redux';
import actions from './actions';

class App extends React.Component {
  componentWillMount() {
    this.props.getArtists();
  }

  render() {
    return (
      <div>
        {(this.props.artists || []).map(a => 
          <div>{a.name}</div>
        )}
      </div>
    );
  }
}

export default connect(s => ({ artists: s.artists }), actions)(App);
```

---
_Source: https://npm.io/package/no-redux · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
