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.