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

docs(en): use case for option function in defineStore #1309

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

trchopan
Copy link

No description provided.

@netlify
Copy link

netlify bot commented May 19, 2022

Deploy Preview for pinia-official ready!

Name Link
🔨 Latest commit b7f958e
🔍 Latest deploy log https://app.netlify.com/sites/pinia-official/deploys/62bfd872347d8000088647df
😎 Deploy Preview https://deploy-preview-1309--pinia-official.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 settings.

@posva
Copy link
Member

posva commented May 19, 2022

This example could be useful for a cookbook entry

@trchopan trchopan force-pushed the usecase-for-function-style-in-define-store branch from abb6d95 to ba2b79e Compare May 19, 2022 15:33
@trchopan
Copy link
Author

Thank you for your response. I've changed it to be a cookbook entry.

@trchopan trchopan changed the title Use case for function style in defineStore docs(en): use case for option function in defineStore May 20, 2022
@posva posva added the 📚 docs Related to documentation changes label Aug 17, 2022
Copy link

@Ilanaya Ilanaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, this pr looks misleading to me - I was wandering around to find some solution for dynamic store registration (implying passing different store ids to the factory function) and got here.

This pr, as I can see, better explains how stores handle states rather than how to create them dynamically. I think the contents should be refactored to better match the pr point.


We can have a creator function like this

```js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example, there should be ts if you want to use type annotations. Nothing critical, but the formatting would be a little bit better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 docs Related to documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants