3 ms·
There is a lit context package in lit-labs, which, like React context, can be used for passing the state across multiple layers of components; but I think that,
by azangru 3y ago
There is a lit context package in lit-labs, which, like React context, can be used for passing the state across multiple layers of components; but I think that, just like with React context, it will not be sufficient if you have a lot of global state. In such a case, some state management library will probably be needed. I don't think Lit has any opinion on what such a library should be. I know some people like to leverage the web platform to its fullest, and just use a class that extends EventTarget for state management (see e.g. https://github.com/thepassle/app-tools/blob/master/state/index.js https://github.com/thepassle/app-tools/blob/master/state/ind...)