import jsonStorageSes from '@pim.sk/utils/jsonStorageSes.mjs'
| localStorage (jsonStorage) | sessionStorage (jsonStorageSes) | |
|---|---|---|
| Persistence | Survives browser close — data stays until explicitly removed | Cleared automatically when the browser tab is closed |
| Scope | Shared across all tabs of the same origin | Isolated per tab — other tabs cannot read it |
| Typical use | User preferences, settings, remembered state | Temporary form state, wizard steps, per-session filters |
Rovnake funkcie a rovnaka logika ako jsonStorage — len s sessionStorage namiesto localStorage pod kapotou.
jsonStorageSes.getItem( name )
jsonStorageSes.setItem( name, values )
jsonStorageSes.setItem( name, values, true ) // force — replace instead of merge
jsonStorageSes.deleteItem( name, key )
jsonStorageSes.removeItem( name )
Priklady pouzitia: jsonStorage tutorial →