vuejs/vue-rx

vue renderes before observable

gotenxds opened this issue · 1 comments

Hello, I have this following piece of code:

    subscriptions: () => ({
      character: getCurrentCharacter
    }),

and in my template:

{{character.id}}

if I try and run the code I get
Cannot read property 'id' of undefined

But if I change my template to

{{character && character.id}}

it works fine, this means that in the first render the observable did not return the character buy then it did and caused a second render

regou commented

@gotenxds It’s Rxjs related expected behavior.
Try emit default value with.startsWith( {} )