@sigx/terminal 0.1.16 → 0.1.18

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.js CHANGED
@@ -301,6 +301,18 @@ var arrayInstrumentations = {};
301
301
  return res;
302
302
  };
303
303
  });
304
+ [
305
+ "includes",
306
+ "indexOf",
307
+ "lastIndexOf"
308
+ ].forEach((method) => {
309
+ arrayInstrumentations[method] = function(...args) {
310
+ const raw = toRaw(this);
311
+ const result = Array.prototype[method].apply(this, args);
312
+ if (result !== -1 && result !== false) return result;
313
+ return Array.prototype[method].apply(raw, args);
314
+ };
315
+ });
304
316
  function signal(target) {
305
317
  if (isPrimitive(target)) return signal({ value: target });
306
318
  const objectTarget = target;
@@ -1027,26 +1039,30 @@ function lazy(loader) {
1027
1039
  if (!promise) promise = loader().then((mod) => {
1028
1040
  Component = "default" in mod ? mod.default : mod;
1029
1041
  state = "resolved";
1030
- loadState.state = "resolved";
1031
- loadState.tick++;
1042
+ batch(() => {
1043
+ loadState.state = "resolved";
1044
+ loadState.tick++;
1045
+ });
1032
1046
  return Component;
1033
1047
  }).catch((err) => {
1034
1048
  error = err instanceof Error ? err : new Error(String(err));
1035
1049
  state = "rejected";
1036
- loadState.state = "rejected";
1037
- loadState.tick++;
1050
+ batch(() => {
1051
+ loadState.state = "rejected";
1052
+ loadState.tick++;
1053
+ });
1038
1054
  throw error;
1039
1055
  });
1040
1056
  else if (state === "pending") promise.then(() => {
1041
- if (loadState.state === "pending") {
1057
+ if (loadState.state === "pending") batch(() => {
1042
1058
  loadState.state = "resolved";
1043
1059
  loadState.tick++;
1044
- }
1060
+ });
1045
1061
  }).catch(() => {
1046
- if (loadState.state === "pending") {
1062
+ if (loadState.state === "pending") batch(() => {
1047
1063
  loadState.state = "rejected";
1048
1064
  loadState.tick++;
1049
- }
1065
+ });
1050
1066
  });
1051
1067
  if (state === "resolved" && Component) return () => {
1052
1068
  return jsx(Component, {});