pinia icon indicating copy to clipboard operation
pinia copied to clipboard

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

Open zavsievich opened this issue 2 years ago • 4 comments

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

zavsievich avatar Jul 13 '22 16:07 zavsievich

Deploy Preview for pinia-official canceled.

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

netlify[bot] avatar Jul 13 '22 16:07 netlify[bot]

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

posva avatar Jul 13 '22 19:07 posva

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

Could you please explain how to fix this?

zavsievich avatar Jul 13 '22 19:07 zavsievich

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!

BlackCrowxyz avatar Jul 18 '22 07:07 BlackCrowxyz

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)

posva avatar Aug 17 '22 11:08 posva