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

Expose getInputTypes and getOutputTypes for instances too #81

Open
slifty opened this issue Aug 24, 2020 · 1 comment
Open

Expose getInputTypes and getOutputTypes for instances too #81

slifty opened this issue Aug 24, 2020 · 1 comment

Comments

@slifty
Copy link
Member

slifty commented Aug 24, 2020

Task

Description

We recently made getInputTypes and getOutputTypes static methods (#77) of IAppliance. This is still correct, but since you cannot access static methods from an instance directly, we may want to add some "sugar" to IAppliance and expose non-static versions as well:

For instance something like

getOutputTypes = () => this.constructor.getOutputTypes()

Thoughts? Does this seem like a good idea? This would allow things like this:

const myAppliance = new Appliance()
console.log(myAppliance.getOutputTypes())

As opposed to:

const myAppliance = new Appliance()
console.log(myAppliance.constructor.getOutputTypes())

Relevant Resources / Research

Related Issues

Issue #77

@slifty
Copy link
Member Author

slifty commented Mar 4, 2022

I'm tempted to close this issue, but with the recent addition of support for dynamic input types this sugar would be even more useful (since the "sugar" could pass the appliance instance's settings automatically).

I think this will probably make sense to include when we go through and do the TypeScript overhaul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant