@builder.io/sdk 2.0.5-0 → 2.0.6
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 +3 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +12 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +12 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.d.ts +1 -0
- package/dist/src/builder.class.js +2 -2
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/observable.class.d.ts +1 -0
- package/dist/src/classes/observable.class.js +9 -0
- package/dist/src/classes/observable.class.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -3
package/dist/index.umd.js
CHANGED
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
var version = "2.0.
|
|
155
|
+
var version = "2.0.5";
|
|
156
156
|
|
|
157
157
|
var Subscription = /** @class */ (function () {
|
|
158
158
|
function Subscription(listeners, listener) {
|
|
@@ -189,9 +189,18 @@
|
|
|
189
189
|
// TODO: follow minimal basic spec: https://github.com/tc39/proposal-observable
|
|
190
190
|
var BehaviorSubject = /** @class */ (function () {
|
|
191
191
|
function BehaviorSubject(value) {
|
|
192
|
+
var _this = this;
|
|
192
193
|
this.value = value;
|
|
193
194
|
this.listeners = [];
|
|
194
195
|
this.errorListeners = [];
|
|
196
|
+
this.then = function () {
|
|
197
|
+
var _a;
|
|
198
|
+
var args = [];
|
|
199
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
200
|
+
args[_i] = arguments[_i];
|
|
201
|
+
}
|
|
202
|
+
return (_a = _this.toPromise()).then.apply(_a, args);
|
|
203
|
+
};
|
|
195
204
|
}
|
|
196
205
|
BehaviorSubject.prototype.next = function (value) {
|
|
197
206
|
this.value = value;
|
|
@@ -2332,7 +2341,7 @@
|
|
|
2332
2341
|
// even though we only use `fetch()` now, we prefer to keep the old behavior and use the `fetch` that comes from
|
|
2333
2342
|
// the core SDK for consistency
|
|
2334
2343
|
Builder.prototype.requestUrl = function (url, options) {
|
|
2335
|
-
return getFetch()(url, options).then(function (res) { return res.json(); });
|
|
2344
|
+
return getFetch()(url, __assign({ next: __assign({ revalidate: 1 }, options === null || options === void 0 ? void 0 : options.next) }, options)).then(function (res) { return res.json(); });
|
|
2336
2345
|
};
|
|
2337
2346
|
Object.defineProperty(Builder.prototype, "host", {
|
|
2338
2347
|
get: function () {
|
|
@@ -2497,7 +2506,7 @@
|
|
|
2497
2506
|
}
|
|
2498
2507
|
var queryStr = QueryString.stringifyDeep(queryParams);
|
|
2499
2508
|
var format = queryParams.format;
|
|
2500
|
-
var requestOptions = { headers: {} };
|
|
2509
|
+
var requestOptions = { headers: {}, next: { revalidate: 1 } };
|
|
2501
2510
|
if (this.authToken) {
|
|
2502
2511
|
requestOptions.headers = __assign(__assign({}, requestOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
|
|
2503
2512
|
}
|