Utils (@pim.sk/utils)

jsonStorageSes

Wrapper around sessionStorage — identical API to jsonStorage. Stores and reads values as JSON objects with the same merge, push and force logic.
import jsonStorageSes from '@pim.sk/utils/jsonStorageSes.mjs'

sessionStorage vs localStorage

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

API

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 →

v 1.1.2