#Can I avoid the getter while keeping the reactivity?

4 messages · Page 1 of 1 (latest)

summer glacier
#
const [organization] = useSelectedOrganization();

const formatMoney = () => moneyFormatter(organization);

organization is reactive. I have a function returning me a money formatter (according to the organization's settings).

The issue is in the code I have to use formatMoney like such:

formatMoney()(amount, currency)

Is it anyhow possible to keep reactivity on organization but to write:

formatMoney(amount, currency)
#

Can I avoid the getter while keeping the reactivity?

reef heart
#
const [organization] = useSelectedOrganization();

const formatMoney = (amount, currency) => moneyFormatter(organization)(amount, currency);
summer glacier
#

Oh man 😂