@twreporter/redux 7.2.1-rc.0 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/lib/reducers/bookmarks.js +14 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.2.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@7.2.2-rc.0...@twreporter/redux@7.2.2) (2022-07-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @twreporter/redux
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [7.2.2-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@7.2.1...@twreporter/redux@7.2.2-rc.0) (2022-06-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* new bookmark should be fetched when mount ([9bb438f](https://github.com/twreporter/twreporter-npm-packages/commit/9bb438f81bd321fee47f55c872589091d8db8be6))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [7.2.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@7.2.1-rc.0...@twreporter/redux@7.2.1) (2022-04-29)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @twreporter/redux
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [7.2.1-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@7.2.0...@twreporter/redux@7.2.1-rc.0) (2022-04-27)
|
|
7
34
|
|
|
8
35
|
|
|
@@ -15,6 +15,10 @@ var _findIndex = _interopRequireDefault(require("lodash/findIndex"));
|
|
|
15
15
|
|
|
16
16
|
var _uniq = _interopRequireDefault(require("lodash/uniq"));
|
|
17
17
|
|
|
18
|
+
var _orderBy = _interopRequireDefault(require("lodash/orderBy"));
|
|
19
|
+
|
|
20
|
+
var _map = _interopRequireDefault(require("lodash/map"));
|
|
21
|
+
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
23
|
|
|
20
24
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -39,7 +43,9 @@ var _ = {
|
|
|
39
43
|
assign: _assign["default"],
|
|
40
44
|
findIndex: _findIndex["default"],
|
|
41
45
|
get: _get["default"],
|
|
42
|
-
uniq: _uniq["default"]
|
|
46
|
+
uniq: _uniq["default"],
|
|
47
|
+
orderBy: _orderBy["default"],
|
|
48
|
+
map: _map["default"]
|
|
43
49
|
};
|
|
44
50
|
var defaultLimit = 10;
|
|
45
51
|
var initState = {
|
|
@@ -77,25 +83,21 @@ function bookmarks() {
|
|
|
77
83
|
total = meta.total,
|
|
78
84
|
limit = meta.limit;
|
|
79
85
|
|
|
80
|
-
var bookmarkIDList = _toConsumableArray(state.bookmarkIDList);
|
|
81
|
-
|
|
82
86
|
var entities = _objectSpread({}, state.entities); // Push new fetched records to stored ones and push ids to id list
|
|
83
87
|
|
|
84
88
|
|
|
85
89
|
fetchedRecords.forEach(function (record) {
|
|
86
90
|
var id = _.get(record, 'id');
|
|
87
91
|
|
|
88
|
-
if (id) {
|
|
89
|
-
|
|
90
|
-
return idInList === id;
|
|
91
|
-
})) {
|
|
92
|
-
bookmarkIDList.push(id);
|
|
93
|
-
} // prevent duplicate items in list
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
entities["".concat(id)] = record;
|
|
92
|
+
if (!id) {
|
|
93
|
+
return;
|
|
97
94
|
}
|
|
95
|
+
|
|
96
|
+
entities["".concat(id)] = record;
|
|
98
97
|
});
|
|
98
|
+
|
|
99
|
+
var bookmarkIDList = _.map(_.orderBy(entities, ['added_at'], ['desc']), 'id');
|
|
100
|
+
|
|
99
101
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
100
102
|
actionType: action.type,
|
|
101
103
|
isRequesting: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/redux",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2",
|
|
4
4
|
"description": "redux actions and reducers for twreporter website",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"files": [
|
|
44
44
|
"lib"
|
|
45
45
|
],
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "675d3d3bd4bb0d2086d3b47ca3fe867cc084a26f"
|
|
47
47
|
}
|