-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use reactive store to share data between components #23996
Conversation
f3b7776
to
d24f8db
Compare
Maybe pinia should be considered. See Vue docs for reasoning. API seems somewhat similar to zustand, so that is a plus for me. It is 7 times bigger than zustand, so I'm a bit sceptical whether it is bloated: Edit: See my question. |
According to https://vuejs.org/guide/scaling-up/state-management.html#simple-state-management-with-reactivity-api , our case is a simple state management, no need to make it that complex IMO Especially we are not making Gitea a SPA, HMR doesn't make sense. |
HMR aka Fast Refresh could be made to work I think with a dev server, it does not require a full SPA. I find it very pleasant to develop without constant F5 after every change 😉. |
Tend to agree we should not go overboard with |
Let's wait for @silverwind 😄 |
Store moved to |
This comment was marked as off-topic.
This comment was marked as off-topic.
OK, let's move on and merge |
* upstream/main: Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (go-gitea#24040) Use reactive store to share data between components (go-gitea#23996) [skip ci] Updated translations via Crowdin Fix accidental overwriting of LDAP team memberships (go-gitea#24050) Add cardtype to org/user level project on creation, edit and view (go-gitea#24043) Fix branch protection priority (go-gitea#24045) Update documentation to explain which projects allow Gitea to host static pages (go-gitea#23993) Fix date display bug (go-gitea#24047) Fine tune markdown editor toolbar (go-gitea#24046) Add tooltips for MD editor buttons and add `muted` class for buttons (go-gitea#23896) Prefer native parser for SSH public key parsing (go-gitea#23798)
Follow #23947
this.hashListener = window.addEventListener()
becauseaddEventListener
returns void/undefined.Reference:
https://vuejs.org/guide/scaling-up/state-management.html#simple-state-management-with-reactivity-api
Screenshot (the same as before):