Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
hazae41 committed Sep 4, 2022
1 parent 49a2d31 commit 6bd7926
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dist/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,18 +1051,22 @@ var Core = /** @class */ (function (_super) {
return [2 /*return*/];
case 2:
next = __assign({ time: Date.now(), data: current === null || current === void 0 ? void 0 : current.data, error: current === null || current === void 0 ? void 0 : current.error, cooldown: current === null || current === void 0 ? void 0 : current.cooldown, expiration: current === null || current === void 0 ? void 0 : current.expiration, aborter: current === null || current === void 0 ? void 0 : current.aborter }, state);
// Force prevent requests from mutating the aborter if it's not their own
if (aborter)
next.aborter = aborter === (current === null || current === void 0 ? void 0 : current.aborter)
? state.aborter
: current === null || current === void 0 ? void 0 : current.aborter;
// Keep the current state if the new state is older
if (next.time !== undefined && next.time < ((_a = current === null || current === void 0 ? void 0 : current.time) !== null && _a !== void 0 ? _a : 0)) {
next.time = current === null || current === void 0 ? void 0 : current.time;
next.data = current === null || current === void 0 ? void 0 : current.data;
next.error = current === null || current === void 0 ? void 0 : current.error;
}
_b = params.equals, equals = _b === void 0 ? DEFAULT_EQUALS : _b;
// Prevent some renders if the data is the same
if (equals(next.data, current === null || current === void 0 ? void 0 : current.data))
next.data = current === null || current === void 0 ? void 0 : current.data;
// Shallow comparison because aborter is not serializable
if (shallowEquals(next, current))
return [2 /*return*/, current];
return [4 /*yield*/, this.set(skey, next, params)];
Expand Down
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,18 +1057,22 @@ var Core = /** @class */ (function (_super) {
return [2 /*return*/];
case 2:
next = __assign({ time: Date.now(), data: current === null || current === void 0 ? void 0 : current.data, error: current === null || current === void 0 ? void 0 : current.error, cooldown: current === null || current === void 0 ? void 0 : current.cooldown, expiration: current === null || current === void 0 ? void 0 : current.expiration, aborter: current === null || current === void 0 ? void 0 : current.aborter }, state);
// Force prevent requests from mutating the aborter if it's not their own
if (aborter)
next.aborter = aborter === (current === null || current === void 0 ? void 0 : current.aborter)
? state.aborter
: current === null || current === void 0 ? void 0 : current.aborter;
// Keep the current state if the new state is older
if (next.time !== undefined && next.time < ((_a = current === null || current === void 0 ? void 0 : current.time) !== null && _a !== void 0 ? _a : 0)) {
next.time = current === null || current === void 0 ? void 0 : current.time;
next.data = current === null || current === void 0 ? void 0 : current.data;
next.error = current === null || current === void 0 ? void 0 : current.error;
}
_b = params.equals, equals = _b === void 0 ? DEFAULT_EQUALS : _b;
// Prevent some renders if the data is the same
if (equals(next.data, current === null || current === void 0 ? void 0 : current.data))
next.data = current === null || current === void 0 ? void 0 : current.data;
// Shallow comparison because aborter is not serializable
if (shallowEquals(next, current))
return [2 /*return*/, current];
return [4 /*yield*/, this.set(skey, next, params)];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hazae41/xswr",
"version": "1.0.56",
"version": "1.0.57",
"author": "hazae41",
"license": "MIT",
"description": "The simplest React data (re)fetching library ever made",
Expand Down

0 comments on commit 6bd7926

Please sign in to comment.