@tanstack/angular-table 9.0.0-beta.1 → 9.0.0-beta.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.
@@ -1187,43 +1187,6 @@ function angularReactivity(injector) {
1187
1187
  };
1188
1188
  }
1189
1189
 
1190
- function createStateProxy(table) {
1191
- const getSnapshot = () => {
1192
- const snapshot = {};
1193
- const stateKeys = Object.keys(table.initialState);
1194
- for (const key of stateKeys) {
1195
- snapshot[key] = table.atoms[key].get();
1196
- }
1197
- return snapshot;
1198
- };
1199
- const target = {};
1200
- return new Proxy(target, {
1201
- get(target, prop, receiver) {
1202
- if (prop === 'toJSON') {
1203
- return getSnapshot;
1204
- }
1205
- if (typeof prop === 'string' && prop in table.initialState) {
1206
- return table.atoms[prop]?.get();
1207
- }
1208
- return Reflect.get(target, prop, receiver);
1209
- },
1210
- has(_, prop) {
1211
- return typeof prop === 'string' && prop in table.initialState;
1212
- },
1213
- ownKeys() {
1214
- return Reflect.ownKeys(table.initialState);
1215
- },
1216
- getOwnPropertyDescriptor(_, prop) {
1217
- if (typeof prop !== 'string' || !(prop in table.initialState)) {
1218
- return undefined;
1219
- }
1220
- return {
1221
- enumerable: true,
1222
- configurable: true,
1223
- };
1224
- },
1225
- });
1226
- }
1227
1190
  /**
1228
1191
  * Creates and returns an Angular-reactive table instance.
1229
1192
  *
@@ -1285,24 +1248,19 @@ function injectTable(options) {
1285
1248
  const injector = inject(Injector);
1286
1249
  const ngZone = inject(NgZone);
1287
1250
  return ngZone.runOutsideAngular(() => lazyInit(() => {
1251
+ // Explicit type arguments skip generic inference from the spread object
1252
+ // (a type-check hot spot); the spread only adds the angular reactivity
1253
+ // binding to `features`.
1288
1254
  const table = constructTable({
1289
1255
  ...options(),
1290
1256
  features: {
1291
- coreReativityFeature: angularReactivity(injector),
1257
+ coreReactivityFeature: angularReactivity(injector),
1292
1258
  ...options().features,
1293
1259
  },
1294
1260
  });
1295
1261
  injector.get(DestroyRef).onDestroy(() => {
1296
1262
  table._reactivity.unmount?.();
1297
1263
  });
1298
- const stateProxy = createStateProxy(table);
1299
- Object.defineProperty(table, 'state', {
1300
- get() {
1301
- return stateProxy;
1302
- },
1303
- configurable: true,
1304
- enumerable: true,
1305
- });
1306
1264
  let isMount = true;
1307
1265
  effect(() => {
1308
1266
  const newOptions = options();
@@ -1331,7 +1289,6 @@ function injectTable(options) {
1331
1289
  * ```ts
1332
1290
  * const { injectAppTable, createAppColumnHelper } = createTableHook({
1333
1291
  * features,
1334
- * rowModels: {},
1335
1292
  * tableComponents: {},
1336
1293
  * cellComponents: {},
1337
1294
  * headerComponents: {},