i am trying to get change from angular-mobx store using rxjs observable. but not getting any change from there, if observed array changed. But if i assign new value using '=' sign then i got change in subscribe. Anyone can explain it ? or help to get change by only change like splice or replace object in array ? thanks
https://stackblitz.com/edit/angular-reuych DEMO APP
import { computed, action, observable } from "mobx-angular";
import {observe } from "mobx";
import { Observable } from 'rxjs';
import { Injectable } from "@angular/core";
import * as moment from "moment-timezone";
@Injectable()
export class Store {toRx(obj, prop) {
return Observable.create(observer =>
observe(obj, prop, (change) => observer.next(change.newValue), true)
);
}
@observable storeCampaigns:any=[];
}
then in a component subscribing like this
this.store.toRx(this.store.storeCampaigns, 'campaigns')
.subscribe(val => {
console.log("calendar get change", val)