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.
Sometimes, you may want to construct a
TDataby using a custom factory method when reading triples back to JS object. For now, the schema only gives back anobjectwithout 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 theschema.readmethod but since this is not recommended, providing a custom func makes more sense.