/* eslint-disable import/prefer-default-export */
import { useStore } from 'stores/hooks';

export function useValue(valueName) {
  const { $calculation } = useStore();

  const storeValue = $calculation.$values.getValue(valueName);

  function setStoreValue(value) {
    $calculation.$values.setValue(valueName, value);
  }

  return [storeValue, setStoreValue];
}
