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
Hello, I'm trying to use redux-orm with Typescript, but I ran into an error when I tried use a custom static methods I that I added to a model Class. I'm pretty new to typescript, maybe I'm doing something wrong.
constsession=orm.session(state);const{products, contacts}=payload;const{ContactGroup, ProductGroup}=session;[ContactGroup,ProductGroup].forEach(modelType=>{modelType.all().toModelArray().forEach(model=>model.delete());});if(contacts){// tslint:disable-next-line: no-angle-bracket-type-assertioncontacts.forEach(contact=>ContactGroup.parse(contact));//<------------------- Error. Property 'parse' does not exist on type 'ModelType<ContactGroup>'.}
Expectation:
I expect parse to be available on model classes for this Session.
Maybe it's a misuse of typescript, but I would really appreciate if someone can help.
The text was updated successfully, but these errors were encountered:
Hello, I'm trying to use redux-orm with Typescript, but I ran into an error when I tried use a custom static methods I that I added to a model Class. I'm pretty new to typescript, maybe I'm doing something wrong.
Here are some files
ProductGroup Model:
Usage:
Expectation:
I expect
parse
to be available on model classes for this Session.Maybe it's a misuse of typescript, but I would really appreciate if someone can help.
The text was updated successfully, but these errors were encountered: