Skip to content

Commit

Permalink
📝 @bpetetot review
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien JUIF committed Jan 8, 2018
1 parent 3ec8de9 commit 7d9396f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ There are multiple factories signatures, take you preferred between :
Parameters are :
- **middlewares** (optional), contain an object with `pre` and `post` fields. Both are an array of middlewares to apply before and after the `core` middleware
- **options** (mandatory), either a string representating the reducer `name`, either an object with these fields :
- **key** (optional), the field used to identify your objects (`id` for example)
- **key** (mandatory), the field used to identify your objects (`id` for example)
- **path** (optional), where the reducer will be combined via `combineReducer`
- if empty, the reducer will be register at the root level of the redux state
- you can use dot notation, like `api.raw`: your reducer will be combined into `state.api.raw.<your_reducer>`
Expand Down
15 changes: 7 additions & 8 deletions TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
- [simpleObject](#simpleobject)

# Factories
Factories is used to create a reducer with its selectors and its actions.
Factories are used to create a reducer with its selectors and its actions.

There are multiple factories signatures, take you preferred between :
There are multiple factories signatures, take you favorite between:
- `factory(middlewares)(options)` : this is the root factory, with middlewares
- `factory(options)` : this is the root factory, without middlewares
- `simpleObject(middlewares)(options)` : this is a `simpleObject` factory with middlewares
Expand All @@ -17,7 +17,7 @@ There are multiple factories signatures, take you preferred between :
Parameters are :
- **middlewares** (optional), contain an object with `pre` and `post` fields. Both are an array of middlewares to apply before and after the `core` middleware
- **options** (mandatory), either a string representating the reducer `name`, either an object with these fields :
- **key** (optional), the field used to identify your objects (`id` for example)
- **key** (mandatory), the field used to identify your objects (`id` for example)
- **path** (optional), where the reducer will be combined via `combineReducer`
- if empty, the reducer will be register at the root level of the redux state
- you can use dot notation, like `api.raw`: your reducer will be combined into `state.api.raw.<your_reducer>`
Expand All @@ -28,7 +28,7 @@ Parameters are :
- **type** (optional) can be `keyValue` or `simpleObject` (default is `keyValue`)
- **defaultData** (optional), for `simpleObject` only, set the default data value, used by `reset` action and for initialisation (default is an empty object `{}`)

You can see documentation about specific types there:
You can see documentation about specific factories there:
- [keyValue](#keyvalue)
- [simpleObject](#simpleobject)

Expand All @@ -48,14 +48,14 @@ import factory from 'k-redux-factory'
export default factory({ type: 'keyValue', /* other options */ })
```

There are multiple factories signatures, take you preferred between :
There are multiple factories signatures, take you favorite between:
- `keyValue(middlewares)(options)` : this is a `keyValue` factory with middlewares
- `keyValue(options)` : this is a `keyValue` factory without middlewares

Parameters are :
- **middlewares** (optional), contain an object with `pre` and `post` fields. Both are an array of middlewares to apply before and after the `core` middleware
- **options** (mandatory), either a string representating the reducer `name`, either an object with these fields :
- **key** (optional), the field used to identify your objects (`id` for example)
- **key** (mandatory), the field used to identify your objects (`id` for example)
- **path** (optional), where the reducer will be combined via `combineReducer`
- if empty, the reducer will be register at the root level of the redux state
- you can use dot notation, like `api.raw`: your reducer will be combined into `state.api.raw.<your_reducer>`
Expand Down Expand Up @@ -115,14 +115,13 @@ import factory from 'k-redux-factory'
export default factory({ type: 'simpleObject', /* other options */ })
```

There are multiple factories signatures, take you preferred between :
There are multiple factories signatures, take you favorite between:
- `simpleObject(middlewares)(options)` : this is a `simpleObject` factory with middlewares
- `simpleObject(options)` : this is a `simpleObject` factory without middlewares

Parameters are :
- **middlewares** (optional), contain an object with `pre` and `post` fields. Both are an array of middlewares to apply before and after the `core` middleware
- **options** (mandatory), either a string representating the reducer `name`, either an object with these fields :
- **key** (optional), the field used to identify your objects (`id` for example)
- **path** (optional), where the reducer will be combined via `combineReducer`
- if empty, the reducer will be register at the root level of the redux state
- you can use dot notation, like `api.raw`: your reducer will be combined into `state.api.raw.<your_reducer>`
Expand Down

0 comments on commit 7d9396f

Please sign in to comment.