README
be-persistent
be-persistent is a behavior/decorator alternative to purr-sist.
Example 1: Default settings;
<input be-persistent>
What this does:
Stores input's value in session storage (key is based on location within the DOM).
The syntax above is short-hand for:
<input be-persistent='{
"what":{
"value": true
},
"when":{
"input": true
},
"where":{
"sessionStorage": true,
"autogenId": true,
},
"restoreIf":{
"always": true,
}
}'>
Example 2: Store to IDB
<input be-persistent='{
"where":{
"idb": true
}
}'>
On refreshing the browser, the input's value is retained.
Example tbd: Criteria [TODO]
<input be-persistent='{
"restoreIf":{
"value":{
"eq": "defaultValue"
}
}
}'>
Example tbd: IBD [TODO]
<input be-persistent='{
"what": {
"value": "myInputValue"
},
"when": ["change"],
"where": {
"IBD":{
"id": "...",
"path": "a.b.c"
}
}
}'>
Example 3: Criteria