Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add warning message if store id already exists (#1394) #1452

Closed
wants to merge 2 commits into from

Conversation

zavsievich
Copy link

Add a toast message if store with current id already exists.

@netlify
Copy link

netlify bot commented Jul 13, 2022

Deploy Preview for pinia-official canceled.

Name Link
🔨 Latest commit 9ff5351
🔍 Latest deploy log https://app.netlify.com/sites/pinia-official/deploys/62d699cb585f9c0008823674

@posva
Copy link
Member

posva commented Jul 13, 2022

Thanks but this doesn't do what you think it does 😓 , it doesn't add the feature you linked. Did you try it?

@zavsievich
Copy link
Author

Thanks but this doesn't do what you think it does 😓

Could you please explain how to fix this?

@BlackCrowxyz
Copy link
Contributor

Thanks but this doesn't do what you think it does 😓

Could you please explain how to fix this?

When changing routes in playground, you can see unnecessary warning messages. Pinia registers stores with id when creating them, reusing stores in other places mean they were registered before with the id so the warning will come up!

Co-authored-by: Pouya Mohammadkhani <31730646+BlackCrowxyz@users.noreply.github.com>
@posva
Copy link
Member

posva commented Aug 17, 2022

Thanks but this does not implement the linked feature, it warns whenever the store is reused (which we don't want ofc).

We don't know if we will implement the feature yet but if you want to give it another shot make sure to:

  • include tests
  • make the warning dev only (just a warn, not the toast)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants