From 7d9396f3801c603d9958d9a420bb8c899e1844af Mon Sep 17 00:00:00 2001 From: Fabien JUIF Date: Mon, 8 Jan 2018 15:34:59 +0100 Subject: [PATCH] :memo: @bpetetot review --- README.md | 2 +- TYPES.md | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 37e3a6c..82b624a 100644 --- a/README.md +++ b/README.md @@ -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.` diff --git a/TYPES.md b/TYPES.md index c340029..ec90882 100644 --- a/TYPES.md +++ b/TYPES.md @@ -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 @@ -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.` @@ -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) @@ -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.` @@ -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.`