schummar-table 0.14.0 → 0.14.3

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/cjs/index.js CHANGED
@@ -171,7 +171,7 @@ function useTableStateStorage(table) {
171
171
  return () => {
172
172
  isCanceled = true;
173
173
  };
174
- }, []);
174
+ }, [table]);
175
175
  react.useEffect(() => {
176
176
  if (!isHydrated)
177
177
  return;
@@ -224,7 +224,7 @@ function useTableStateStorage(table) {
224
224
  }, {
225
225
  throttle: 1e3
226
226
  });
227
- }, [isHydrated]);
227
+ }, [table, isHydrated]);
228
228
  async function clear() {
229
229
  await q.run(async () => {
230
230
  const persist = table.getState().props.persist;
@@ -232,14 +232,11 @@ function useTableStateStorage(table) {
232
232
  return;
233
233
  }
234
234
  const {
235
- storage
235
+ storage,
236
+ id
236
237
  } = persist;
237
- const keys = "keys" in storage ? await storage.keys() : await Promise.all(Array(storage.length).fill(0).map((_x, i) => storage.key(i)));
238
- for (const key of keys) {
239
- if (key !== null) {
240
- await storage.removeItem(key);
241
- }
242
- }
238
+ await storage.removeItem(storageName(id));
239
+ setIsHydrated(false);
243
240
  q.clear();
244
241
  });
245
242
  }
@@ -3438,6 +3435,8 @@ exports.mergeThemes = mergeThemes;
3438
3435
  exports.startOfDay = startOfDay;
3439
3436
  exports.termMatch = termMatch;
3440
3437
  exports.textMatch = textMatch;
3438
+ exports.thisWeek = thisWeek;
3439
+ exports.today = today;
3441
3440
  exports.useColumnContext = useColumnContext;
3442
3441
  exports.useFilter = useFilter;
3443
3442
  exports.useTableContext = useTableContext;