mobx#makeAutoObservable JavaScript Examples

The following examples show how to use mobx#makeAutoObservable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserStore.js    From 1km.co.il with MIT License 6 votes vote down vote up
constructor(rootStore) {
    makeAutoObservable(this, { rootStore: false });
    this.rootStore = rootStore;

    auth.onAuthStateChanged(async (user) => {
      if (user) {
        let userData = await getFullUserData(user.uid);
        // On initial user creation getFullUserData returns underfined - so we update the user with partial details.
        // https://github.com/guytepper/1km.co.il/pull/114
        if (userData === undefined) {
          userData = { uid: user.uid, email: user.email };
        }
        this.user = userData;
      }
    });

    this.checkCache();
  }
Example #2
Source File: transfer-settings.js    From albedo with MIT License 6 votes vote down vote up
constructor(network, mode = 'direct') {
        this.network = network
        this.mode = mode
        this.asset = ['XLM', 'XLM']
        this.amount = ['0', '0']
        this.conversionSlippage = 0.5
        makeAutoObservable(this)

        autorun(() => {
            const {
                destination,
                mode,
                asset,
                amount,
                conversionDirection,
                conversionSlippage,
                currentLedgerSequence
            } = this
            this.recalculateSwap()
        })

        this.findConversionPath = debounce(400, false, this.findConversionPath.bind(this))
    }
Example #3
Source File: CallApiStore.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
constructor() {
        makeAutoObservable(this);
        this.CallApi = new CallApi();
    }
Example #4
Source File: ClusterStore.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
//모니터링 지속 저장 값을 위한 변수
  constructor() {
    makeAutoObservable(this);
    this.clusterApi = new ClusterMonitApi();
  }
Example #5
Source File: DBApiStore.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
constructor() {
        makeAutoObservable(this);
        this.DBApi = new DBApi();
    }
Example #6
Source File: WorkloadDetailStore.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
constructor() {
        makeAutoObservable(this);
        this.workalodDetail = new WorkloadDetail();
        this.dbApi = new DBApi();
    }
Example #7
Source File: WorkloadStore.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
constructor() {
        makeAutoObservable(this);
        this.workalod = new WorkloadDetail();
        this.dbApi = new DBApi();
    }
Example #8
Source File: LiveStore.js    From 1km.co.il with MIT License 5 votes vote down vote up
constructor(rootStore) {
    makeAutoObservable(this, { rootStore: false });
    this.rootStore = rootStore;
  }
Example #9
Source File: MapStore.js    From 1km.co.il with MIT License 5 votes vote down vote up
constructor(rootStore) {
    makeAutoObservable(this, { rootStore: false });
    this.rootStore = rootStore;
  }
Example #10
Source File: ProtestStore.js    From 1km.co.il with MIT License 5 votes vote down vote up
constructor(rootStore) {
    makeAutoObservable(this, { rootStore: false });
    this.rootStore = rootStore;
  }
Example #11
Source File: RootStore.js    From 1km.co.il with MIT License 5 votes vote down vote up
constructor() {
    makeAutoObservable(this);
    this.userStore = new userStore(this);
    this.protestStore = new ProtestStore(this);
    this.mapStore = new MapStore(this);
    this.liveStore = new LiveStore(this);
    this.checkCache();
  }
Example #12
Source File: account-notification-counter.js    From albedo with MIT License 5 votes vote down vote up
constructor(network, address) {
        this.network = network
        this.address = address
        makeAutoObservable(this)
        this.initCounters()
    }
Example #13
Source File: dashboard-settings.js    From albedo with MIT License 5 votes vote down vote up
constructor() {
        makeAutoObservable(this, {currentNetwork: observable})
        this.currentNetwork = 'testnet'
    }
Example #14
Source File: liquidity-pool-deposit-settings.js    From albedo with MIT License 5 votes vote down vote up
constructor(network) {
        this.network = network
        this.amount = ['', '']
        this.asset = ['XLM', 'XLM']
        this.poolInfo = {loaded: false}
        makeAutoObservable(this)
    }
Example #15
Source File: liquidity-pool-withdraw-settings.js    From albedo with MIT License 5 votes vote down vote up
constructor(network, poolId) {
        this.network = network
        this.poolId = poolId
        this.share = '0'
        this.poolInfo = {loaded: false}
        makeAutoObservable(this)
        this.loadPoolInfo()
    }