lablup / backend.ai-webui

Backend.AI Web UI for web / desktop app (Windows/Linux/macOS). Backend.AI Web UI provides a convenient environment for users, while allowing various commands to be executed without CLI. It also provides some visual features that are not provided by the CLI, such as dashboards and statistics.
https://www.backend.ai
GNU Lesser General Public License v3.0
110 stars 73 forks source link

hooks: useMemoWithPrevious #2819

Closed yomybaby closed 3 weeks ago

yomybaby commented 3 weeks ago

Sometimes, when using useMemo, you may need to utilize the previous value. To achieve this, let's implement a custom hook that memoizes not only the value of useMemo but also the previous value when the dependency list is updated.