Replies: 2 comments 1 reply
-
I think it's a little unclear exactly what you're asking for here... "context" is a very broad term, but in the framework world it has come to most often mean providing data to components in the tree without directly passing it to them. The data can be arbitrary (no specific format like XML or JSON) and is usually not persisted across page loads, except as it's loaded in whatever way the page might load any data anyway. We have a context system at @lit-labs/context, though I don't think that's quite what you're looking for. If you're looking for persistent data, then I would say that we should prefer existing standard browser APIs like Local Storage and IndexedDB. It's possible that we could vend some helper Reactive Controllers, like we've done with the @lit-labs/observers package, to make it easier to use and wire up updates to elements. Would that help you? |
Beta Was this translation helpful? Give feedback.
-
You might also be interested in global state as a way to provide data to components. This one allows to handles persistence via localStorage: https://www.npmjs.com/package/@lit-app/state. |
Beta Was this translation helpful? Give feedback.
-
for developing in cross over pages, it is important to manage context.
the html5 supports some browser level store api(local storage, sqlite3 level db, etc ...)
but normally many people are not familer to control thoeses. they are more familer to manuplating data by xml or json, especially json.
so, how about the lit supports to create "LitContextElement"?
i know lit router like react-router is in lit-labs.
But i think it is not normal and not natural and not free. i mean theses are not low level implementing for expression.
html is also XML(super set of xml). so html also can be used like json.
I think if lit supports like "LitContextElement" then it is very useful and ez.
how do you think?
Beta Was this translation helpful? Give feedback.
All reactions