rxjs-spy
rxjs-spy copied to clipboard
detect doesn't work with custom plugin config
detect throws up the warning 'Snapshotting is not enabled.' if you don't use the defaultPlugin setting.
import { create } from 'rxjs-spy';
import {
GraphPlugin,
SnapshotPlugin,
StackTracePlugin,
StatsPlugin,
} from 'rxjs-spy/plugin';
const spy = create({
defaultPlugins: false,
warning: true,
});
spy.plug(
new StackTracePlugin({ sourceMaps: false }),
new GraphPlugin({ keptDuration: 15000 }),
new SnapshotPlugin(spy, { keptValues: 4 }),
new StatsPlugin(spy),
);
window['spy'].detect();
The problem seems to be that you create the Detector object during create() and the Detector only looks for the snapshot plugin in the constructor.
https://github.com/cartant/rxjs-spy/blob/master/source/spy-core.ts#L108 https://github.com/cartant/rxjs-spy/blob/master/source/detector.ts#L48
Yeah. That is a problem, but I'm not going to fix it right now.
When I release rxjs-devtools
- which I'm working on ATM - rxjs-spy
is going to be deprecated. I've removed the detector from rxjs-devtools
as it includes a superior and less-intrusive mechanism for doing what I attempted to do with the detector in rxjs-spy
.