Skip to content

Commit

Permalink
enhance: DevToolsManager uses maxAge to set buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed May 8, 2024
1 parent 8d67abb commit e4d5f01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-needles-crash.md
@@ -0,0 +1,5 @@
---
"@data-client/core": patch
---

[DevToolsManager](https://dataclient.io/docs/api/DevToolsManager) uses [maxAge](https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md#maxage) to set buffer size
2 changes: 2 additions & 0 deletions packages/core/src/manager/DevtoolsManager.ts
Expand Up @@ -96,6 +96,8 @@ export default class DevToolsManager implements Manager {
...DEFAULT_CONFIG,
...config,
});
// we cut it in half so we should double so we don't lose
if (config?.maxAge) this.maxBufferLength = config.maxAge * 2;
if (process.env.NODE_ENV !== 'production' && this.devTools) {
this.devTools.subscribe((msg: any) => {
switch (msg.type) {
Expand Down

0 comments on commit e4d5f01

Please sign in to comment.