Skip to content

Commit ab76881

Browse files
fix(devtools): support reducer tracking for stub (#277)
1 parent 05a5ad5 commit ab76881

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

libs/ngrx-toolkit/src/lib/devtools/tests/with-tracked-reducer.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { delay, tap } from 'rxjs';
1919
import { withDisabledNameIndices } from '../features/with-disabled-name-indicies';
2020
import { withGlitchTracking } from '../features/with-glitch-tracking';
2121
import { updateState } from '../update-state';
22+
import { withDevToolsStub } from '../with-dev-tools-stub';
2223
import { withDevtools } from '../with-devtools';
2324
import { withTrackedReducer } from '../with-tracked-reducer';
2425
import { setupExtensions } from './helpers.spec';
@@ -243,6 +244,15 @@ describe('withTrackedReducer', () => {
243244
);
244245
expect(() => TestBed.inject(Store)).not.toThrow();
245246
});
247+
248+
it('should not throw with stubbed devtools', () => {
249+
const Store = signalStore(
250+
{ providedIn: 'root' },
251+
withDevToolsStub('store'),
252+
withTrackedReducer(),
253+
);
254+
expect(() => TestBed.inject(Store)).not.toThrow();
255+
});
246256
});
247257
});
248258

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { signalStoreFeature, withProps } from '@ngrx/signals';
2+
import { GLITCH_TRACKING_FEATURE } from './features/with-glitch-tracking';
23
import { DEVTOOL_FEATURE_NAMES, withDevtools } from './with-devtools';
34
/**
45
* Stub for DevTools integration. Can be used to disable DevTools in production.
56
*/
67
export const withDevToolsStub: typeof withDevtools = () =>
78
signalStoreFeature(
89
withProps(() => ({
9-
[DEVTOOL_FEATURE_NAMES]: [],
10+
[DEVTOOL_FEATURE_NAMES]: [GLITCH_TRACKING_FEATURE],
1011
})),
1112
);

0 commit comments

Comments
 (0)