Skip to content
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

Add more useful typescript type for modelInstance.attrs #1002

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

IanVS
Copy link
Collaborator

@IanVS IanVS commented Oct 28, 2021

I've found that I sometimes need to get the attributes of a model, but typescript was typing as a generic unknown object. I think we can type it the same as the properties that are added directly to the model itself, based on the wording of https://miragejs.com/api/classes/model/#attrs.

@IanVS
Copy link
Collaborator Author

IanVS commented Nov 22, 2021

@zoltan-nz it looks like you added the original TS types. Does this change seem reasonable to you?

@zoltan-nz
Copy link
Contributor

@IanVS Thanks for the update, yep, it looks good to me. Nice improvement. :)

@IanVS IanVS merged commit ce8173f into miragejs:master Nov 28, 2021
@IanVS IanVS deleted the attr-type branch November 28, 2021 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants