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

refactor: simplify types in playground store #50

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

posva
Copy link
Contributor

@posva posva commented Nov 30, 2023

Hello! These are just my recommendations to make the types simpler in Pinia. It revolves around letting pinia infer the final types for you and using export type PlaygroundStore = ReturnType<typeof usePlaygroundStore> to infer the final store type used by mountPlayground().

One thing I would personally also do is move (back) the mountPlayground to the store and refactor the actions object so they can be regular actions without replacing them at mount. I didn't include those changes to make this refactor clear but let me know if you want me to also add it.

I could also come during a stream to explain some of the things if you want, or I can just do it from the chat too.

I didn't know about Raw<T>, I think I should improve pinia types so adding this manually isn't necessary.

Copy link

netlify bot commented Nov 30, 2023

Deploy Preview for learn-nuxt-com ready!

Name Link
🔨 Latest commit 199533d
🔍 Latest deploy log https://app.netlify.com/sites/learn-nuxt-com/deploys/6568615344eb3b0008304b8c
😎 Deploy Preview https://deploy-preview-50--learn-nuxt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu merged commit 94a5efd into nuxt:main Nov 30, 2023
5 checks passed
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.

2 participants