This is some useful properties which makes to manage you application easier and which you will not find in other
frameworks(but may be you will)
Safe data locally
You can save any data locally, just adding in you component property ‘saveLocally’. Property ‘saveLocally’ is a function which should return nested array and saves properties locally.
You can add as many properties as you wish, property can be a string or object/array no matter. Syntax of returned array is [saving_property,
uniqe_key_for_saving]
Example
com({
name: 'my-app',
data: { input: 'Lorem Ipsum' },
saveLocally() {
return [['input', 'input_state']];
},
tpl() {
return html`
<h3>Change value and reload page</h3>
<input j-model="input" />
`;
},
});
More of Magic will be added after comleteng and testing...