|
this.database = new LowSync(new JSONFileSync("Todos.json")); |
The line above won't compile anymore as they have modified how it currently works; the new signature is
new LowSync(adapterSync, defaultData)
To make it compile successfully you should have now
const defaultData: schemaType = { tasks: [] }
before
export class JsonTodoCollection extends TodoCollection {
and your old line
this.database = new LowSync(new JSONFileSync("Todos.json"));
should become
this.database = new LowSync(new JSONFileSync("Todos.json"), defaultData);
That should be it, really.
essential-typescript-5/Chapter 02/todo/src/jsonTodoCollection.ts
Line 15 in e76019c
The line above won't compile anymore as they have modified how it currently works; the new signature is
To make it compile successfully you should have now
before
and your old line
should become
That should be it, really.