Skip to content

v-stream data is not being updated in componentInstance #106

Closed
@MariuszWitkowski

Description

@MariuszWitkowski

v-stream data is not being updated in componentInstance

When i update array rows then my data in v-stream is not updated.

This work

<div v-for="row in rows">
    <input type="checkbox" :id="row.id" v-stream:change="{ subject: change$, data: { id: row.id } }"/>
</div>

This not working

<div v-for="row in rows">
    <Checkbox :id="row.id" v-stream:change="{ subject: change$, data: { id: row.id } }" />
</div>

I think this is problem in directive v-stream:

  ...
  
  bind (el, binding, vnode) {
    ...

    if (!modifiers.native && vnode.componentInstance) {
      ...
    } else {
      ...

      // store handle on element with a unique key for identifying
      // multiple v-stream directives on the same node
      ;(el._rxHandles || (el._rxHandles = {}))[getKey(binding)] = handle
    }
  },
  ...

should be

  ...
  
  bind (el, binding, vnode) {
    ...

    if (!modifiers.native && vnode.componentInstance) {
      ...
    } else {
      ...
    }
    // store handle on element with a unique key for identifying
    // multiple v-stream directives on the same node
    ;(el._rxHandles || (el._rxHandles = {}))[getKey(binding)] = handle
  },
  ...

then data in stream directive is correctly updated on replace rows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions