Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit dbc0662

Browse files
committed
🐛 use spread instead of force update
1 parent 211d88b commit dbc0662

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mixin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { warn } from "./util";
22
import { Subject, Subscription, isObservable } from "rxjs";
33

4+
45
export default {
56
created() {
67
const vm = this;
8+
console.log(this)
79
const domStreams = vm.$options.domStreams;
810

911
if (domStreams) {
1012
domStreams.forEach(key => {
1113
vm[key] = new Subject();
1214
});
1315
}
14-
1516
const observableMethods = vm.$options.observableMethods;
1617
if (observableMethods) {
1718
if (Array.isArray(observableMethods)) {
@@ -50,7 +51,7 @@ export default {
5051
obs[key].subscribe(
5152
value => {
5253
vm[key] = value;
53-
this.$forceUpdate();
54+
vm = {...vm}
5455
},
5556
error => {
5657
throw error;
@@ -61,6 +62,7 @@ export default {
6162
}
6263
},
6364

65+
6466
beforeUnmount() {
6567
if (this._subscription) {
6668
this._subscription.unsubscribe();

0 commit comments

Comments
 (0)