From 1442f96f123811f56fff076d690eff1f17230a0d Mon Sep 17 00:00:00 2001 From: Chika Date: Wed, 6 Jul 2022 20:49:46 +0300 Subject: [PATCH] Form/PaymentsTable: optimize inputs --- stores/tables/payments/hooks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stores/tables/payments/hooks.js b/stores/tables/payments/hooks.js index 5f72c9d..b51fca3 100644 --- a/stores/tables/payments/hooks.js +++ b/stores/tables/payments/hooks.js @@ -1,9 +1,10 @@ +import { computed } from 'mobx'; import { useStore } from 'stores/hooks'; export function useRowValue(index) { const { $tables } = useStore(); - const storeValue = $tables.payments.getValue(index); + const storeValue = computed(() => $tables.payments.getValue(index)).get(); function setStoreValue(value) { $tables.payments.setValue(index, value); @@ -15,7 +16,7 @@ export function useRowValue(index) { export function useRowStatus(index) { const { $tables } = useStore(); - const status = $tables.payments.getStatus(index); + const status = computed(() => $tables.payments.getStatus(index)).get(); return status; }