@schibsted/niche-utils
v0.6.2
Published
This package contains utilities used in multiple projects and packages used by Niche team. **Use at your own risk.**
Downloads
9,796
Maintainers
Keywords
Readme
niche-utils
This package contains utilities used in multiple projects and packages used by Niche team. Use at your own risk.
Exported methods
getEventTarget
Safely returns new EventTarget instance. If EventTarget
is not supported, returns document.createElement('a')
which should work the same way.
getFromLocalStorage
, saveToLocalStorage
, removeFromLocalStorage
Local storage methods to safely get, save and remove data from local storage. If local storage is not supported, get returns undefined
and other methods do nothing.