You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to add a subscription/observable to my component using the guide in the Readme.
subscriptions(){// declaratively map to another property with Rx operatorsreturn{aPlusOne: this.$watchAsObservable('prompt.choices').subscribe(({ newValue, oldValue })=>console.log('choices',newValue,oldValue))}},
However I get this error in my dev tools console. No clue as to why it is invalid. What are the rules, what am I missing. Not entirely clear from the docs. Do I need to pre-define it somewhere?
vue.common.js?4eb4:2643 [Vue warn]: Invalid Observable found in subscriptions option with key "aPlusOne".
(found in component <prompt-checkbox> at /Users/kristianmandrup/repos/vue-projs/app-generator/app/src/components/Prompt/Checkbox.vue)
I'm trying to react to updates on a set of checkboxes in order to save those values in my store so other components can reflect on it... However I can't seem to find a way to do it.
Maybe using simple watch? I tried without luck using on-change handlers, but they only pass true|false on, so I have no idea which checkbox the changed value is coming from :O
<md-checkboxv-for="choice in prompt.choices"
:name="prompt.name"
:id="prompt.name"
@input="updateChoice"
@change="updateChoice($event)"class="md-primary"v-model="choice.value">{{choice.label }}</md-checkbox>
I always receive simply true or false in my updateChoice(e) method :(
Is watch the way to go!? or computed properties? Doesn't seem right, coz then I would have to watch/react to the entire object iterated and bound to by the checkboxes.
Please advice :) Thanks!
The text was updated successfully, but these errors were encountered:
When you call .subscribe(), the returned value is no longer an Observable but a Subscription. To produce side effects while retaining the original Observable, use .do instead of .subscribe.
Hi guys,
I've been trying to add a subscription/observable to my component using the guide in the Readme.
However I get this error in my dev tools console. No clue as to why it is
invalid
. What are the rules, what am I missing. Not entirely clear from the docs. Do I need to pre-define it somewhere?I'm trying to react to updates on a set of checkboxes in order to save those values in my store so other components can reflect on it... However I can't seem to find a way to do it.
Maybe using simple
watch
? I tried without luck using on-change handlers, but they only passtrue|false
on, so I have no idea which checkbox the changed value is coming from :OI always receive simply
true
orfalse
in myupdateChoice(e)
method :(Is
watch
the way to go!? orcomputed
properties? Doesn't seem right, coz then I would have to watch/react to the entire object iterated and bound to by the checkboxes.Please advice :) Thanks!
The text was updated successfully, but these errors were encountered: