set Method

Sets a new value under the given key in session storage. Before storing, the value is serialized to a JSON string format

@param key: string
The specific key under which the value will be stored

@param value: T
The new value to be stored, which will be stringified before being added

API

set(key: string, value: T): void;

Example

import {sessionStorage} from '@bitfiber/rx';
 
const ss = sessionStorage();
ss.set('key', 'value');