Skip to content

Add factory func to schema #29

@YuukanOO

Description

@YuukanOO

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlow energyRepresents a task which does not need a lot of energy

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions