# redux-use

> A easy way to use redux base on `@reduxjs/toolkit` and react hooks.

Latest version **1.1.2** (published 2022-04-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-04-19 |
| First published | 2021-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 52.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | 4074 |
| Maintainers | wenfeng |

## Links

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

## Recent versions

- 1.1.2 (latest) — 2022-04-19
- 1.1.1 — 2021-11-17
- 1.0.0 — 2021-05-25
- 0.1.1 — 2021-04-20
- 0.1.0 — 2021-04-17

## README

# redux-use

[![NPM version][npm-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/redux-use
[npm-url]: https://www.npmjs.com/package/redux-use

A easy way to use redux base on `@reduxjs/toolkit` and react hooks.

## Usage

There are just 3 methods.

```ts
import reduxu from 'redux-use'

// async
const list = reduxu.async(
  //
  async () => {
    return fetch('path/to/load/list').then((res) => res.json())
  },
  {
    // As same as options of `@reduxjs/toolkit/createSlice`
    // name: string,
    // reducers: {},
    // extraReducers: (builder) => {}
  },
)

// sync
const listFilter = reduxu.sync({
  // As same as options of `@reduxjs/toolkit/createSlice`
  // name: string,
  // initialState: {}
  // reducers: {},
  // extraReducers: (builder) => {}
})

// Export the combianed reducer
export default reduxu.reducer()
```

## Example

Run the todo app demo.

```sh
# example/server
yarn install
yarn start

# example/app
yarn install
yarn start
```

## Sharing

![img](./sharing/images/redux-share.001.png)
![img](./sharing/images/redux-share.002.png)
![img](./sharing/images/redux-share.003.png)
![img](./sharing/images/redux-share.004.png)
![img](./sharing/images/redux-share.005.png)
![img](./sharing/images/redux-share.006.png)
![img](./sharing/images/redux-share.007.png)
![img](./sharing/images/redux-share.008.png)

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