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

Add factory func to schema #29

Open
YuukanOO opened this issue Sep 15, 2020 · 0 comments
Open

Add factory func to schema #29

YuukanOO opened this issue Sep 15, 2020 · 0 comments
Labels
enhancement New feature or request low energy Represents a task which does not need a lot of energy
Milestone

Comments

@YuukanOO
Copy link
Contributor

Sometimes, you may want to construct a TData by using a custom factory method when reading triples back to JS object. For now, the schema only gives back an object without prototype.

By giving the client the opportunity to provide a custom factory method, we enable a lot of scenario when a user want to retrieve object of a specific prototype.

I was first thinking of using the Object.setPrototypeOf() in the schema.read method but since this is not recommended, providing a custom func makes more sense.

@YuukanOO YuukanOO added enhancement New feature or request low energy Represents a task which does not need a lot of energy labels Sep 15, 2020
@YuukanOO YuukanOO added this to the Planned milestone Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low energy Represents a task which does not need a lot of energy
Projects
None yet
Development

No branches or pull requests

1 participant