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

Update API endpoint for creating DVSections and DVCharts #27

Open
AleksueiR opened this issue Mar 8, 2018 · 0 comments
Open

Update API endpoint for creating DVSections and DVCharts #27

AleksueiR opened this issue Mar 8, 2018 · 0 comments

Comments

@AleksueiR
Copy link
Member

Right now, DQV exposes corresponding classes on the API which require the use of the new keyword:

const dvchart = new DQV.Chart({ ... });
const dvsection = new DQV.Section({ ... });

@alyec has pointed out that in many cases the reference to a DVChart object is not needed on the host page (DQV keeps track of them internally), so the calls end up like this:

new DQV.Chart({ ... });
const dvsection = new DQV.Section({ ... });
dvsection.mount( ... );

This invokes the wrath of the tslint's no-unused-expression rule.

Update DQV endpoints to expose a function instead of the class, which also returns the newly constructed object. Being a simple function call, it obeys the rule and doesn't look as offensive as a snowman.

DQV.Chart({ ... });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant