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

Getter not reactive with a Vue.observable? #10857

Closed
maximelebreton opened this issue Nov 22, 2019 · 1 comment
Closed

Getter not reactive with a Vue.observable? #10857

maximelebreton opened this issue Nov 22, 2019 · 1 comment

Comments

@maximelebreton
Copy link

@maximelebreton maximelebreton commented Nov 22, 2019

Version

2.6.10

Reproduction link

https://codesandbox.io/s/getters-reactivity-with-observable-5gn6q

Steps to reproduce

  • Go to the input
  • type something inside
  • and you will see that the observable is reactive, but the getter is not...
  • Why? and how can i make this getter reactive?

What is expected?

The getter should be reactive

What is actually happening?

The observable is reactive, but the getter (who returns the observable) is not reactive.


Because Vuex is not Typescript friendly, and outdated especially since vue composition-api, I try to recreate a kind of store, as native as possible.
My goal is to split my states / getters / actions in different files, and import them like classic javascript variables / functions, to limit the magic / boilerplates.

PS: I was very interested by Effector (https://effector.now.sh/), but Vue doesn't provide a way to share/interact reactivity with other reactive libraries (symbol-observable, .subscribe?), so I can't use it, too bad, you should take a look.

@posva

This comment has been minimized.

Copy link
Member

@posva posva commented Nov 23, 2019

observable needs objects to be able to detect changes:

export const $searchInput = observable({ value: 'Test me' });

Because Vuex is not Typescript friendly, and outdated especially since vue composition-api, I try to recreate a kind of store, as native as possible.
My goal is to split my states / getters / actions in different files, and import them like classic javascript variables / functions, to limit the magic / boilerplates.

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.

@posva posva closed this Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.