Skip to content

Commit f5cb0bb

Browse files
committed
changed default payload and error values to undefined for better lodash support
1 parent f6f162b commit f5cb0bb

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ The contents of `responseCallback` argument are:
152152
- `isLoaded: boolean` - `true` if there's no error and request was successfull. Usually means that its payload contains the response data.
153153
- `isError: boolean` - `true` if there's an error while making this request
154154
- `isFinished: boolean` - `true` if either `isLoaded` or `isError` is `true`.
155-
- `payload: object` - response body if there was no error. Default: `null`,
156-
- `error: object` - error detail if there was an error. Default: `null`.
155+
- `payload: object` - response body if there was no error. Default: `undefined`,
156+
- `error: object` - error detail if there was an error. Default: `undefined`.
157157
- `refresh: function` - a function that triggers re-fetch of data no matter what.
158158

159159
# HOW-TOs

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-data-subscription",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Data provider for React applications. Simplifies data flow by handling component's props and state changes, automatically fetching new data if necessary and applying it directly to component's state. Forget about promises, sagas, callbacks etc. This higher order component provides your component with a single prop that does the magic.",
55
"main": "dist/index.js",
66
"scripts": {

src/store/entity.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default class Entity extends EventEmitter {
1919

2020
this.body = {
2121
...DEFAULT_STATE,
22-
payload: null,
23-
error: null,
22+
payload: undefined,
23+
error: undefined,
2424
};
2525
}
2626

src/store/subscription.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class Subscription extends EventEmitter {
120120
isLoaded: true,
121121
isFinished: true,
122122
payload,
123-
error: null,
123+
error: undefined,
124124
});
125125
})
126126
.catch(error => {
@@ -129,7 +129,7 @@ export default class Subscription extends EventEmitter {
129129
isRefreshing: false,
130130
isError: true,
131131
isFinished: true,
132-
payload: null,
132+
payload: undefined,
133133
error,
134134
});
135135
});

0 commit comments

Comments
 (0)