@t007/toast 0.0.10 → 0.0.11
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/dist/index.global.js +2 -2
- package/dist/index.js +2 -2
- package/dist/standalone.js +2 -2
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
this.destroyed = false;
|
|
130
130
|
}
|
|
131
131
|
update(options) {
|
|
132
|
-
if (!options || isObj(options)) return this.opts.id;
|
|
132
|
+
if (!options || !isObj(options)) return this.opts.id;
|
|
133
133
|
try {
|
|
134
134
|
this.opts = { ...this.opts, ...options };
|
|
135
135
|
const run = () => Object.keys(options).forEach((key) => this[key] = options[key]);
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
type: ""
|
|
440
440
|
}),
|
|
441
441
|
promise(base, promise = new Promise((res, rej) => setTimeout(Math.round(Math.random()) ? res : rej, 3e3)), { pending, success, error } = {}) {
|
|
442
|
-
if (!promise || isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
442
|
+
if (!promise || !isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
443
443
|
const NFC = (input, type) => isStr(input) ? { render: input, type } : isObj(input) ? { ...input, type } : { type };
|
|
444
444
|
const pendingConfig = NFC(pending);
|
|
445
445
|
const pendingToastId = base.loading(pendingConfig.render || "Promise pending...", { ...pendingConfig });
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var T007_Toast = class {
|
|
|
23
23
|
this.destroyed = false;
|
|
24
24
|
}
|
|
25
25
|
update(options) {
|
|
26
|
-
if (!options || isObj(options)) return this.opts.id;
|
|
26
|
+
if (!options || !isObj(options)) return this.opts.id;
|
|
27
27
|
try {
|
|
28
28
|
this.opts = { ...this.opts, ...options };
|
|
29
29
|
const run = () => Object.keys(options).forEach((key) => this[key] = options[key]);
|
|
@@ -333,7 +333,7 @@ var toasting = {
|
|
|
333
333
|
type: ""
|
|
334
334
|
}),
|
|
335
335
|
promise(base, promise = new Promise((res, rej) => setTimeout(Math.round(Math.random()) ? res : rej, 3e3)), { pending, success, error } = {}) {
|
|
336
|
-
if (!promise || isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
336
|
+
if (!promise || !isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
337
337
|
const NFC = (input, type) => isStr(input) ? { render: input, type } : isObj(input) ? { ...input, type } : { type };
|
|
338
338
|
const pendingConfig = NFC(pending);
|
|
339
339
|
const pendingToastId = base.loading(pendingConfig.render || "Promise pending...", { ...pendingConfig });
|
package/dist/standalone.js
CHANGED
|
@@ -127,7 +127,7 @@ var T007_Toast = class {
|
|
|
127
127
|
this.destroyed = false;
|
|
128
128
|
}
|
|
129
129
|
update(options) {
|
|
130
|
-
if (!options || isObj(options)) return this.opts.id;
|
|
130
|
+
if (!options || !isObj(options)) return this.opts.id;
|
|
131
131
|
try {
|
|
132
132
|
this.opts = { ...this.opts, ...options };
|
|
133
133
|
const run = () => Object.keys(options).forEach((key) => this[key] = options[key]);
|
|
@@ -437,7 +437,7 @@ var toasting = {
|
|
|
437
437
|
type: ""
|
|
438
438
|
}),
|
|
439
439
|
promise(base, promise = new Promise((res, rej) => setTimeout(Math.round(Math.random()) ? res : rej, 3e3)), { pending, success, error } = {}) {
|
|
440
|
-
if (!promise || isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
440
|
+
if (!promise || !isFunc(promise.then)) return console.error("toast.promise() requires a valid promise");
|
|
441
441
|
const NFC = (input, type) => isStr(input) ? { render: input, type } : isObj(input) ? { ...input, type } : { type };
|
|
442
442
|
const pendingConfig = NFC(pending);
|
|
443
443
|
const pendingToastId = base.loading(pendingConfig.render || "Promise pending...", { ...pendingConfig });
|