koota 0.1.11 → 0.1.12

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.
@@ -1124,14 +1124,15 @@ function createQueryResult(query, world, params) {
1124
1124
  const trait2 = traits[index];
1125
1125
  const ctx = trait2[$internal];
1126
1126
  const newValue = state[index];
1127
+ const store = stores[index];
1127
1128
  let changed = false;
1128
1129
  if (ctx.type === "aos") {
1129
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1130
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1130
1131
  if (!changed) {
1131
- changed = !shallowEqual(newValue, atomicSnapshots[j]);
1132
+ changed = !shallowEqual(newValue, atomicSnapshots[index]);
1132
1133
  }
1133
1134
  } else {
1134
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1135
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1135
1136
  }
1136
1137
  if (changed) changedPairs.push([entity, trait2]);
1137
1138
  }
@@ -1139,7 +1140,8 @@ function createQueryResult(query, world, params) {
1139
1140
  const index = untrackedIndices[j];
1140
1141
  const trait2 = traits[index];
1141
1142
  const ctx = trait2[$internal];
1142
- ctx.fastSet(eid, stores[index], state[index]);
1143
+ const store = stores[index];
1144
+ ctx.fastSet(eid, store, state[index]);
1143
1145
  }
1144
1146
  }
1145
1147
  for (let i = 0; i < changedPairs.length; i++) {
package/dist/index.cjs CHANGED
@@ -1102,14 +1102,15 @@ function createQueryResult(query, world, params) {
1102
1102
  const trait2 = traits[index];
1103
1103
  const ctx = trait2[$internal];
1104
1104
  const newValue = state[index];
1105
+ const store = stores[index];
1105
1106
  let changed = false;
1106
1107
  if (ctx.type === "aos") {
1107
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1108
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1108
1109
  if (!changed) {
1109
- changed = !shallowEqual(newValue, atomicSnapshots[j]);
1110
+ changed = !shallowEqual(newValue, atomicSnapshots[index]);
1110
1111
  }
1111
1112
  } else {
1112
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1113
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1113
1114
  }
1114
1115
  if (changed) changedPairs.push([entity, trait2]);
1115
1116
  }
@@ -1117,7 +1118,8 @@ function createQueryResult(query, world, params) {
1117
1118
  const index = untrackedIndices[j];
1118
1119
  const trait2 = traits[index];
1119
1120
  const ctx = trait2[$internal];
1120
- ctx.fastSet(eid, stores[index], state[index]);
1121
+ const store = stores[index];
1122
+ ctx.fastSet(eid, store, state[index]);
1121
1123
  }
1122
1124
  }
1123
1125
  for (let i = 0; i < changedPairs.length; i++) {
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  relation,
14
14
  trait,
15
15
  universe
16
- } from "./chunk-WPSZAQ4Y.js";
16
+ } from "./chunk-FAWXK4QV.js";
17
17
  export {
18
18
  $internal,
19
19
  Not,
package/dist/react.cjs CHANGED
@@ -1094,14 +1094,15 @@ function createQueryResult(query, world, params) {
1094
1094
  const trait2 = traits[index];
1095
1095
  const ctx = trait2[$internal];
1096
1096
  const newValue = state[index];
1097
+ const store = stores[index];
1097
1098
  let changed = false;
1098
1099
  if (ctx.type === "aos") {
1099
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1100
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1100
1101
  if (!changed) {
1101
- changed = !shallowEqual(newValue, atomicSnapshots[j]);
1102
+ changed = !shallowEqual(newValue, atomicSnapshots[index]);
1102
1103
  }
1103
1104
  } else {
1104
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1105
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1105
1106
  }
1106
1107
  if (changed) changedPairs.push([entity, trait2]);
1107
1108
  }
@@ -1109,7 +1110,8 @@ function createQueryResult(query, world, params) {
1109
1110
  const index = untrackedIndices[j];
1110
1111
  const trait2 = traits[index];
1111
1112
  const ctx = trait2[$internal];
1112
- ctx.fastSet(eid, stores[index], state[index]);
1113
+ const store = stores[index];
1114
+ ctx.fastSet(eid, store, state[index]);
1113
1115
  }
1114
1116
  }
1115
1117
  for (let i = 0; i < changedPairs.length; i++) {
package/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  $internal,
3
3
  createWorld
4
- } from "./chunk-WPSZAQ4Y.js";
4
+ } from "./chunk-FAWXK4QV.js";
5
5
 
6
6
  // ../react/src/hooks/use-query.ts
7
7
  import { useEffect, useMemo, useReducer } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koota",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "🌎 Performant real-time state management for React and TypeScript",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -40,8 +40,8 @@
40
40
  "rimraf": "^6.0.1",
41
41
  "tsup": "^8.3.0",
42
42
  "@koota/core": "0.0.1",
43
- "tsconfig": "0.1.0",
44
- "@koota/react": "0.0.1"
43
+ "@koota/react": "0.0.1",
44
+ "tsconfig": "0.1.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@react-three/fiber": "^8.17.10",
package/react/index.cjs CHANGED
@@ -1094,14 +1094,15 @@ function createQueryResult(query, world, params) {
1094
1094
  const trait2 = traits[index];
1095
1095
  const ctx = trait2[$internal];
1096
1096
  const newValue = state[index];
1097
+ const store = stores[index];
1097
1098
  let changed = false;
1098
1099
  if (ctx.type === "aos") {
1099
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1100
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1100
1101
  if (!changed) {
1101
- changed = !shallowEqual(newValue, atomicSnapshots[j]);
1102
+ changed = !shallowEqual(newValue, atomicSnapshots[index]);
1102
1103
  }
1103
1104
  } else {
1104
- changed = ctx.fastSetWithChangeDetection(eid, stores[j], newValue);
1105
+ changed = ctx.fastSetWithChangeDetection(eid, store, newValue);
1105
1106
  }
1106
1107
  if (changed) changedPairs.push([entity, trait2]);
1107
1108
  }
@@ -1109,7 +1110,8 @@ function createQueryResult(query, world, params) {
1109
1110
  const index = untrackedIndices[j];
1110
1111
  const trait2 = traits[index];
1111
1112
  const ctx = trait2[$internal];
1112
- ctx.fastSet(eid, stores[index], state[index]);
1113
+ const store = stores[index];
1114
+ ctx.fastSet(eid, store, state[index]);
1113
1115
  }
1114
1116
  }
1115
1117
  for (let i = 0; i < changedPairs.length; i++) {
package/react/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  $internal,
3
3
  createWorld
4
- } from "../dist/chunk-WPSZAQ4Y.js";
4
+ } from "../dist/chunk-FAWXK4QV.js";
5
5
 
6
6
  // ../react/src/hooks/use-query.ts
7
7
  import { useEffect, useMemo, useReducer } from "react";