-
Notifications
You must be signed in to change notification settings - Fork 221
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
TypeScript - Backing store support #2613
Comments
To restore backing store capabilities since we migrated to interfaces we probably need the do the following:
|
This is a rough draft of how to accomplish the task: on the abstraction library I'll have the following classes: export interface IBackedModel {
/**
* Gets the store that is backing the model.
*/
backingStore: BackingStore;
}
class BackedModel implements IBackedModel {
private backingStore: BackingStore;
constructor(backingStore: BackingStore) {
this.backingStore = backingStore;
}
} NB: the other classes e.g. // Generated code
export interface Foo extends Entity, Parsable {
name?: string | undefined;
}
export class FooBackedModel extends BackedModel implements Foo {
get name(): string | undefined {
return this.backingStore.get(name);
}
set name(value: string | undefined) {
this.backingStore.name = value;
}
} |
@baywet let me know if the above steps need any changes |
this would require people to use classes again, which we'd like to avoid. |
Adding @gavinbarron for more insights and potentially workshopping with @koros |
No description provided.
The text was updated successfully, but these errors were encountered: