2023-04-21 11:13:58 +03:00

33 lines
762 B
JavaScript

import { useStore } from '@/stores/hooks';
import { computed } from 'mobx';
export function useRowValue(index) {
const { $tables } = useStore();
const storeValue = computed(() => $tables.payments.getValue(index)).get();
function setStoreValue(value) {
$tables.payments.setValue(index, value);
}
return [storeValue, setStoreValue];
}
export function useRowSum(index) {
const { $tables } = useStore();
const storeValue = computed(() => $tables.payments.getSum(index)).get();
function setStoreValue(value) {
$tables.payments.setSum(index, value);
}
return [storeValue, setStoreValue];
}
export function useRowStatus(index) {
const { $tables } = useStore();
return computed(() => $tables.payments.getStatus(index)).get();
}