@cocreate/local-storage
Advanced tools
Comparing version 1.13.0 to 1.14.0
@@ -0,1 +1,8 @@ | ||
# [1.14.0](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.13.0...v1.14.0) (2024-01-17) | ||
### Features | ||
* observe added nodes [localstorage-set] ([7aff443](https://github.com/CoCreate-app/CoCreate-local-storage/commit/7aff4437cd4188fffb8d570df1eb31a4218045b2)) | ||
# [1.13.0](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.12.0...v1.13.0) (2023-11-25) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@cocreate/local-storage", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"description": "A Simple component similar to CoCreate-input & CoCreate-fetch which Save and fetch data for inputs, textarea, selects from localstorage. Easily configured using HTML5 attributes and/or JavaScript API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -189,4 +189,15 @@ import observer from '@cocreate/observer'; | ||
observer.init({ | ||
observe: ['addedNodes'], | ||
target: "[localstorage-set]", | ||
callback: async function (mutation) { | ||
let key = mutation.target.getAttribute('localstorage-set') | ||
let value = await mutation.target.getValue() | ||
if (key && value) | ||
localStorage.setItem(key, value) | ||
} | ||
}); | ||
CoCreateLocalStorage.checkSupport() | ||
export default CoCreateLocalStorage; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106313
19
306