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

Fix subscriptions in Vuex #164

Open
fadeev opened this issue Jan 12, 2022 · 0 comments
Open

Fix subscriptions in Vuex #164

fadeev opened this issue Jan 12, 2022 · 0 comments
Assignees
Labels
bug Something isn't working closed-after-ts-client Already solved by SDK but not published yet.

Comments

@fadeev
Copy link
Contributor

fadeev commented Jan 12, 2022

subscriptions are added with objects as keys
which means the comparison to see if an action is already subscribed to fails
and it gets readded
(similarly it's impossible to unsuibscribe for)

Change:

		SUBSCRIBE(state, subscription) {
			state._Subscriptions.add(subscription)
		},
		UNSUBSCRIBE(state, subscription) {
			state._Subscriptions.delete(subscription)
		}

To:

		SUBSCRIBE(state, subscription) {
			state._Subscriptions.add(JSON.stringify(subscription))
		},
		UNSUBSCRIBE(state, subscription) {
			state._Subscriptions.delete(JSON.stringify(subscription))
		}

Both in standard Vuex modules as well as in the generated code.

https://github.com/tendermint/starport/blob/6edbc99ff58d7e8c18a2eb2671fd63feebb1d976/starport/pkg/cosmosgen/templates/vuex/store/index.ts.tpl

@marinhoarthur marinhoarthur self-assigned this Jan 18, 2022
@marinhoarthur marinhoarthur added the bug Something isn't working label Jan 18, 2022
@marinhoarthur marinhoarthur added the closed-after-ts-client Already solved by SDK but not published yet. label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closed-after-ts-client Already solved by SDK but not published yet.
Projects
None yet
Development

No branches or pull requests

2 participants