Do i need to manually unsubscribe, if used in method
bagaskarala opened this issue · 2 comments
bagaskarala commented
I'm using nuxt 2.17 with this package
- "rxjs": "^6.6.3"
- "vue-rx": "^6.2.0"
i'm wonder whether i need to unsubscribe from the observable or not, if i use it like below:
methods: {
getOrders() {
this.$orderService
.getOrder()
.pipe(map((res) => res.data))
.subscribe((response) => {
this.orders = response.data.orders;
});
},
}
regou commented
Yes, you need to unsubscribe manually
Try this: beforeDestroy$
bagaskarala commented
Yes, you need to unsubscribe manually Try this: beforeDestroy$
@regou what will happen and the effect of this if i'm not unsubscribe? because i can call this method multiple time.