Skip to content

Commit

Permalink
Fixing scope for dispatchCustomEvent on melody stream components.
Browse files Browse the repository at this point in the history
  • Loading branch information
krakenfuss committed Apr 10, 2019
1 parent fa935f7 commit 264499a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
{
"path": "./packages/melody-streams/lib/index.js",
"maxSize": "1.52 kB"
"maxSize": "1.53 kB"
}
]
}
3 changes: 2 additions & 1 deletion packages/melody-streams/src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function Component(element) {
Object.assign(Component.prototype, {
type: 'streaming',
apply(props) {
const _this = this;
this.propsStream.next(props);
if (this.subscriptions.length === 0) {
const t = this.getTransform({
Expand All @@ -61,7 +62,7 @@ Object.assign(Component.prototype, {
...options,
detail,
});
this.el.dispatchEvent(event);
_this.el.dispatchEvent(event);
},
props: this.propsStream,
updates: this.updates,
Expand Down

0 comments on commit 264499a

Please sign in to comment.