Any way to persist a nested class? what would be the right way to handle class like that with nano stores? #217
-
export class Patient {
id: number;
name: string;
medicalHistory: string[];
constructor(
id: number,
name: string,
) {
this.id = id;
this.name = name;
this.medicalHistory = [];
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
ai
Jul 9, 2023
Replies: 1 comment 7 replies
-
Yes, you can create |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like you want to keep too many in a single store.
I suggest having 2 different stores. One for patients from the server. The second for the client-side draft. Just use the same type to share the keys between them.
To load data from server you can use Nano Store Query or write your own store: