get Method

Retrieves a value stored under the given key in session storage. The retrieved value is parsed from its JSON string format into the expected type T. If the key does not exist or if parsing fails, returns ‘undefined’

@param key: string
The specific key under which the value is stored in session storage

@returns T

API

get(key: string): T;

Example

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