gm-datagrid 0.1.3 → 0.1.4
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/engine/useEngineSync.d.ts +9 -6
- package/dist/gm-datagrid.js +475 -483
- package/dist/gm-datagrid.umd.cjs +6 -6
- package/package.json +1 -1
|
@@ -16,13 +16,16 @@ interface UseEngineSyncProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* Syncs React state → Wasm engine (push) and pulls page data + subtotals back.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* IMPORTANT: push and pull are intentionally in ONE effect, not two.
|
|
20
|
+
* wasm-bindgen wraps GridEngine methods with a runtime borrow-check on `&mut self`.
|
|
21
|
+
* Two separate effects that both call engine methods can fire in the same
|
|
22
|
+
* synchronous React flush — the second effect starts before wasm-bindgen has
|
|
23
|
+
* released the `&mut` borrow from the first, triggering:
|
|
24
|
+
* "recursive use of an object detected which would lead to unsafe aliasing in rust"
|
|
23
25
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
+
* Keeping everything in a single effect guarantees all engine calls are sequential
|
|
27
|
+
* within one borrow, and the pull (get_page / get_subtotals) always sees the
|
|
28
|
+
* data that was just loaded.
|
|
26
29
|
*/
|
|
27
30
|
export declare function useEngineSync({ engine, ready, rows, columns, onSynced, page, pageSize, onPageData, sortStack, filterGroup, quickFilterText, }: UseEngineSyncProps): void;
|
|
28
31
|
export {};
|