22
33### Table of Contents
44
5- - [ handleSuccess] [ 1 ]
6- - [ Parameters] [ 2 ]
7- - [ Examples] [ 3 ]
8- - [ handleFailure] [ 4 ]
9- - [ Parameters] [ 5 ]
10- - [ Examples] [ 6 ]
11- - [ handleResponse] [ 7 ]
12- - [ Parameters] [ 8 ]
13- - [ Examples] [ 9 ]
14- - [ setOnSuccess] [ 10 ]
15- - [ Parameters] [ 11 ]
16- - [ Examples] [ 12 ]
17- - [ setOnFailure] [ 13 ]
18- - [ Parameters] [ 14 ]
19- - [ Examples] [ 15 ]
20- - [ setOnResponse] [ 16 ]
21- - [ Parameters] [ 17 ]
22- - [ Examples] [ 18 ]
23- - [ LP_API ] [ 19 ]
24- - [ Examples] [ 20 ]
25- - [ createRequest] [ 21 ]
26- - [ Parameters] [ 22 ]
27- - [ Examples] [ 23 ]
28- - [ middleware] [ 24 ]
29- - [ reducer] [ 25 ]
30- - [ Examples] [ 26 ]
31- - [ selectors] [ 27 ]
32- - [ Examples] [ 28 ]
33- - [ createStubRequest] [ 29 ]
34- - [ Parameters] [ 30 ]
35- - [ Examples] [ 31 ]
5+ * [ handleSuccess] [ 1 ]
6+ * [ Parameters] [ 2 ]
7+ * [ Examples] [ 3 ]
8+ * [ handleFailure] [ 4 ]
9+ * [ Parameters] [ 5 ]
10+ * [ Examples] [ 6 ]
11+ * [ handleResponse] [ 7 ]
12+ * [ Parameters] [ 8 ]
13+ * [ Examples] [ 9 ]
14+ * [ setOnSuccess] [ 10 ]
15+ * [ Parameters] [ 11 ]
16+ * [ Examples] [ 12 ]
17+ * [ setOnFailure] [ 13 ]
18+ * [ Parameters] [ 14 ]
19+ * [ Examples] [ 15 ]
20+ * [ setOnResponse] [ 16 ]
21+ * [ Parameters] [ 17 ]
22+ * [ Examples] [ 18 ]
23+ * [ LP \_ API ] [ 19 ]
24+ * [ Examples] [ 20 ]
25+ * [ createRequest] [ 21 ]
26+ * [ Parameters] [ 22 ]
27+ * [ Examples] [ 23 ]
28+ * [ middleware] [ 24 ]
29+ * [ reducer] [ 25 ]
30+ * [ Examples] [ 26 ]
31+ * [ selectors] [ 27 ]
32+ * [ Examples] [ 28 ]
33+ * [ createStubRequest] [ 29 ]
34+ * [ Parameters] [ 30 ]
35+ * [ Examples] [ 31 ]
3636
3737## handleSuccess
3838
3939A function that takes an API action handler and only applies that handler when the request succeeds.
4040
4141### Parameters
4242
43- - ` handler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
43+ * ` handler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
4444
4545### Examples
4646
@@ -61,7 +61,7 @@ A function that takes an API action handler and only applies that handler when t
6161
6262### Parameters
6363
64- - ` handler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
64+ * ` handler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
6565
6666### Examples
6767
@@ -83,8 +83,8 @@ and applies the handlers when the responses have the correct status.
8383
8484### Parameters
8585
86- - ` successHandler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
87- - ` failureHandler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
86+ * ` successHandler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
87+ * ` failureHandler ` ** [ Function] [ 32 ] ** An action handler that is passed ` state ` , ` action ` and ` data ` params
8888
8989### Examples
9090
@@ -111,8 +111,8 @@ A function that creates an API action handler that sets a path in the state with
111111
112112### Parameters
113113
114- - ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned data
115- - ` transform ` ** [ Function] [ 32 ] ?** A function that determines the data that is set in the state. Passed ` action ` and ` state ` params.
114+ * ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned data
115+ * ` transform ` ** [ Function] [ 32 ] ?** A function that determines the data that is set in the state. Passed ` action ` and ` state ` params.
116116
117117### Examples
118118
@@ -131,8 +131,8 @@ A function that creates an API action handler that sets a path in the state with
131131
132132### Parameters
133133
134- - ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned error
135- - ` transform ` ** [ Function] [ 32 ] ?** A function that determines the data that is set in the state. Passed ` action ` and ` state ` params.
134+ * ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned error
135+ * ` transform ` ** [ Function] [ 32 ] ?** A function that determines the data that is set in the state. Passed ` action ` and ` state ` params.
136136
137137### Examples
138138
@@ -151,10 +151,10 @@ A function that creates an API action handler that sets one of two given paths i
151151
152152### Parameters
153153
154- - ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned data on success
155- - ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned error on failure
156- - ` transform ` ** [ Function] [ 32 ] ?** A function that determines the success data that is set in the state. Passed ` action ` and ` state ` params.
157- - ` transform ` ** [ Function] [ 32 ] ?** A function that determines the error data that is set in the state. Passed ` action ` and ` state ` params.
154+ * ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned data on success
155+ * ` path ` ** [ String] [ 33 ] ** The path in the state to set with the returned error on failure
156+ * ` transform ` ** [ Function] [ 32 ] ?** A function that determines the success data that is set in the state. Passed ` action ` and ` state ` params.
157+ * ` transform ` ** [ Function] [ 32 ] ?** A function that determines the error data that is set in the state. Passed ` action ` and ` state ` params.
158158
159159### Examples
160160
@@ -167,7 +167,7 @@ handleActions({
167167
168168Returns ** [ Function] [ 32 ] ** An action handler
169169
170- ## LP_API
170+ ## LP \_ API
171171
172172A unique key that identifies dispatched actions to be handled by the LP
173173Redux Api middleware. This is implemented as a Symbol, instead of a String
@@ -186,8 +186,8 @@ function fooAction () {
186186 return {
187187 [LP_API ]: {
188188 url: ' http://foo.com/posts' ,
189- requestAction: ' REQUEST' ,
190- successAction: ' SUCCESS' ,
189+ requestAction: ' REQUEST' ,
190+ successAction: ' SUCCESS' ,
191191 failureAction: ' FAILURE' ,
192192 }
193193 }
@@ -202,8 +202,8 @@ Note: there are convenience functions for each request method: `createPostReques
202202
203203### Parameters
204204
205- - ` type ` ** [ String] [ 33 ] ** A unique key that will be used to identify the request internally in redux
206- - ` definition ` ** ([ Object] [ 36 ] \ | [ Function] [ 32 ] )** An object of config options for the adapter, or a function that returns config options.
205+ * ` type ` ** [ String] [ 33 ] ** A unique key that will be used to identify the request internally in redux
206+ * ` definition ` ** ([ Object] [ 36 ] | [ Function] [ 32 ] )** An object of config options for the adapter, or a function that returns config options.
207207
208208### Examples
209209
@@ -243,11 +243,11 @@ The `adapter` argument is the function that will be invoked to make the API requ
243243
244244The following options may be used to configure the middleware:
245245
246- - ` onUnauthorized ` (default=` null ` ): An action creator to be called and dispatched when the server rejects a request with a status of ` unauthorized ` .
247- - ` requestAction ` (default=` null ` ): An action creator to be called and dispatched when the initial request is made.
248- - ` successAction ` (default=` null ` ): An action creator to be called and dispatched if the request succeeds.
249- - ` failureAction ` (default=` null ` ): An action creator to be called and dispatched if the request fails.
250- - any options used by the adapter
246+ * ` onUnauthorized ` (default=` null ` ): An action creator to be called and dispatched when the server rejects a request with a status of ` unauthorized ` .
247+ * ` requestAction ` (default=` null ` ): An action creator to be called and dispatched when the initial request is made.
248+ * ` successAction ` (default=` null ` ): An action creator to be called and dispatched if the request succeeds.
249+ * ` failureAction ` (default=` null ` ): An action creator to be called and dispatched if the request fails.
250+ * any options used by the adapter
251251
252252## reducer
253253
@@ -286,22 +286,22 @@ selectStatus(REQ_FETCH_USERS, state) // -> 'loading'
286286
287287This library exports the following selectors for determining the status of requests:
288288
289- - ` selectors.status(state, requestAction, [slice]) `
290- - ` selectors.hasStatus(state, requestAction, [slice]) `
291- - ` selectors.isLoading(state, requestAction, [slice]) `
292- - ` selectors.isComplete(state, requestAction, [slice]) `
293- - ` selectors.isSuccess(state, requestAction, [slice]) `
294- - ` selectors.isFailure(state, requestAction, [slice]) `
289+ * ` selectors.status(state, requestAction, [slice]) `
290+ * ` selectors.hasStatus(state, requestAction, [slice]) `
291+ * ` selectors.isLoading(state, requestAction, [slice]) `
292+ * ` selectors.isComplete(state, requestAction, [slice]) `
293+ * ` selectors.isSuccess(state, requestAction, [slice]) `
294+ * ` selectors.isFailure(state, requestAction, [slice]) `
295295
296296In order to work, the ` lp-redux-api ` reducer must be included in ` combineReducers() ` .
297297Selectors expect the reducer to be keyed under ` 'api' ` - if a different key is used,
298298it must be passed as the optional ` slice ` parameter.
299299
300300The status returned by ` selectors.status() ` can be one of the following exported constants:
301301
302- - ` LP_API_STATUS_LOADING ` : ` 'loading' `
303- - ` LP_API_STATUS_SUCCESS ` : ` 'success' `
304- - ` LP_API_STATUS_FAILURE ` : ` 'failure' `
302+ * ` LP_API_STATUS_LOADING ` : ` 'loading' `
303+ * ` LP_API_STATUS_SUCCESS ` : ` 'success' `
304+ * ` LP_API_STATUS_FAILURE ` : ` 'failure' `
305305
306306### Examples
307307
@@ -336,10 +336,11 @@ If an exception is thrown from the data creator function, the "request" will rej
336336
337337### Parameters
338338
339- - ` type ` ** [ String] [ 33 ] ** A unique key that will be used to identify the request internally in redux
340- - ` dataDefinition ` ** ([ Object] [ 36 ] \| [ Function] [ 32 ] )** Data that the request will resolve with, or a function that returns data to resolve with.
341- - ` options ` ** [ Object] [ 36 ] ?** Options object
342- - ` options.delay ` ** [ Number] [ 39 ] ** Time (in ms) to delay the API request. Particularly useful when attempting to simulate loading states. (optional, default ` 0 ` )
339+ * ` type ` ** [ String] [ 33 ] ** A unique key that will be used to identify the request internally in redux
340+ * ` dataDefinition ` ** ([ Object] [ 36 ] | [ Function] [ 32 ] )** Data that the request will resolve with, or a function that returns data to resolve with.
341+ * ` options ` ** [ Object] [ 36 ] ?** Options object
342+
343+ * ` options.delay ` ** [ Number] [ 39 ] ** Time (in ms) to delay the API request. Particularly useful when attempting to simulate loading states. (optional, default ` 0 ` )
343344
344345### Examples
345346
0 commit comments