silverstripe-asset-admin
silverstripe-asset-admin copied to clipboard
Use caching instead of polling in HistoryList
Description
To determine if the history list requires a refresh we send request every 250 ms in refreshHistoryIfNeeded.
This needs a delay/throttle, so this api request tries to be made last in the stack. We also use this to stop an API call happening if the component is going to unmount soon.
This could potentially be solved by using apollo-client's caching and graphql. See: https://github.com/silverstripe/silverstripe-asset-admin/blob/02728e1adcf5c912b3ab0d8dc64963a717139d0f/client/src/containers/HistoryList/HistoryList.js#L78