# redux-boot

> Minimal Framework using Redux to develop modularized universal Apps.

Latest version **1.1.3** (published 2017-07-14) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2017-07-14 |
| First published | 2016-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 126 |
| Maintainers | choko-org |

## Links

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

## Recent versions

- 1.1.3 (latest) — 2017-07-14
- 1.1.2 — 2016-11-29
- 1.1.1 — 2016-08-24
- 1.1.0 — 2016-06-01
- 1.0.0 — 2016-05-25
- 0.1.4 — 2016-05-13
- 0.1.3 — 2016-05-13
- 0.1.2 — 2016-04-27
- 0.1.1 — 2016-04-15

## README

# Redux Boot

Modular [Redux](http://redux.js.org) bootstrap with asynchronous side-effects.

[![Build Status](https://travis-ci.org/choko-org/redux-boot.svg?branch=master)](https://travis-ci.org/choko-org/redux-boot)

## What is Redux Boot?

Minimal Framework using [Redux](http://redux.js.org) to develop modularized universal (backend and frontend) applications, based on functional programming paradigms and friends such as Map and Reduce, Immutability and Reactive programming.

 > "Simplicity is the ultimate sophistication."
 > -- Leonardo da Vinci

## What Redux Boot provides?

- **Module API** - Clean **organization and reuse patterns** for your code.
- **Async side-effects** - **No-brainer** async side-effects with [redux-actions](https://github.com/acdlite/redux-actions) and [redux-promise](https://github.com/acdlite/redux-promise).

## Examples:

- [Todo MVC](https://github.com/choko-org/redux-boot-todomvc) example.
- The [bootstrap tests](https://github.com/choko-org/redux-boot/blob/master/test/bootstrap.test.js).
- Simple [web server App](https://github.com/choko-org/redux-boot-web-app-example).

## Documentation

  For more details see the [documentation](https://choko.gitbooks.io/redux-boot/content/index.html).

## Getting started

**Install**

```sh
npm install redux-boot --save
```

**Basic Usage**

```js
import boot, {BOOT} from 'redux-boot'

const initialState = {
  foo: 'bar'
}

const testModule = {
  reducer: {  
    [BOOT]: (state, action) => {
      return {
        ...state,
        foo: 'baz'
      }
    }
  }
}

const modules = [
  testModule
]

const app = boot(initialState, modules)

app.then(({action, store}) => {

  // Should print 'baz'.
  console.log(store.getState().foo)
})
```

**Sync middleware (with redux-actions)**

```js
import boot, {BOOT} from 'redux-boot'
import {createAction} from 'redux-actions'

const CHANGE_FOO = 'redux-boot/test/CHANGE_FOO'

const changeFoo = createAction(CHANGE_FOO)

const initialState = {
  foo: 'bar'
}

const testModule = {
  reducer: {
    [CHANGE_FOO]: (state, action) => {
      return {
        ...state,
        foo: action.payload
      }
    }
  },

  middleware: {
    [BOOT]: store => next => action => {
      store.dispatch(changeFoo('baz'))
      return next(action)
    }
  }
}

const modules = [
  testModule
]

const app = boot(initialState, modules)

app.then(({action, store}) => {

  // Should print 'baz'.
  console.log(store.getState().foo)
})
```

**Async middleware (with redux-action and redux-promise)**

```js
import boot, {BOOT} from 'redux-boot'
import {createAction} from 'redux-actions'

const CHANGE_FOO = 'redux-boot/test/CHANGE_FOO'

const changeFoo = createAction(CHANGE_FOO, async (value) => {

  return new Promise((resolve, reject) => {
    setTimeout(() => resolve(value), 1)
  })
})

const initialState = {
  foo: 'bar'
}

const testModule = {
  reducer: {
    [CHANGE_FOO]: (state, action) => {
      return {
        ...state,
        foo: action.payload
      }
    }
  },

  middleware: {
    [BOOT]: store => next => async action => {
      const result = next(action)
      await store.dispatch(changeFoo('baz'))
      return result
    }
  }
}

const modules = [
  testModule
]

const app = boot(initialState, modules)

app.then(({action, store}) => {

  // Should print 'baz'.
  console.log(store.getState().foo)
})
```

### Development setup:

**Install**

```sh
git clone https://github.com/choko-org/redux-boot.git
npm install
```

**Build**

```sh
npm run build
```

**Build and Run the tests**

```sh
npm test
```

## License

[MIT](LICENSE.md)

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