[ivette] Several fixes
- The `useSelection` hooks did not memoized the returned `setSelection` function, leading to performance issues if a hook depended on it. - The standard behavior for `usePromise` is to take a building function and dependencies, automatically memoized the constructed promise, and then doing as before. However, we keep a `usePromiseNoMemo` with the previous behavior. It seems needed for the `theme` handling. - `useCache` new hook allows to add a cache to a given function. It also takes an optional serialization function for complex types for which standard equality does not provide the expected behavior.
Showing
- ivette/src/dome/renderer/dome.tsx 40 additions, 2 deletionsivette/src/dome/renderer/dome.tsx
- ivette/src/dome/renderer/themes.tsx 1 addition, 1 deletionivette/src/dome/renderer/themes.tsx
- ivette/src/frama-c/kernel/SourceCode.tsx 1 addition, 2 deletionsivette/src/frama-c/kernel/SourceCode.tsx
- ivette/src/frama-c/states.ts 4 additions, 1 deletionivette/src/frama-c/states.ts
Please register or sign in to comment