Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect doesn't work with custom plugin config #43

Open
jecraig opened this issue Feb 20, 2019 · 2 comments
Open

detect doesn't work with custom plugin config #43

jecraig opened this issue Feb 20, 2019 · 2 comments
Labels

Comments

@jecraig
Copy link

jecraig commented Feb 20, 2019

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();
@jecraig
Copy link
Author

jecraig commented Feb 20, 2019

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

@cartant
Copy link
Owner

cartant commented Feb 20, 2019

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.

@cartant cartant added the bug label Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants