You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When modifying a table with a generic parameter that extends a type, I get a compile error:
importDexie,{Table}from'dexie';interfaceEntity{id: string;property: string;}exportabstractclassAbstractStorageService<TextendsEntity>extendsDexie{protectedreadonlyitems: Table<T,string>;protectedconstructor(databaseName: string){super(databaseName);}asyncmodifyProperty(id: string,value: string): Promise<void>{// This line does not compile.awaitthis.items.where({ id }).modify({property: value});}}
When the table does not have a generic parameter, it compiles just fine:
importDexie,{Table}from'dexie';exportabstractclassStorageServiceextendsDexie{protectedreadonlyitems: Table<Entity,string>;protectedconstructor(databaseName: string){super(databaseName);}asyncmodifyProperty(id: string,value: string): Promise<void>{// This line compiles.awaitthis.items.where({ id }).modify({property: value});}}
I think both cases should be fine. Am I missing something? 🤔
The text was updated successfully, but these errors were encountered:
When modifying a table with a generic parameter that extends a type, I get a compile error:
When the table does not have a generic parameter, it compiles just fine:
I think both cases should be fine. Am I missing something? 🤔
The text was updated successfully, but these errors were encountered: