V
V
Vladimir Golub2020-12-09 18:17:53
Vue.js
Vladimir Golub, 2020-12-09 18:17:53

How to use state values ​​from another when describing the state of one module?

There is a module with general application settings that are set when the application starts and can change depending on the request. For example, the application language and work area There is a module with values ​​that depend on them.

Can I use a simple import ?

import { AppState } from './app';

export const state = () => ({
  currency: AppState.lang === 'ru' ? 'rub' : 'usd'
});


Or is there another solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2020-12-10
@RazerVG

Maybe when filling the first module in the action, call the action of the second module and the problem will be solved?))) Why is it necessary to look for strange ways of working with the storage?
So you can also nightmare the global event bus to track changes ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question