localStorage Function

Creates a singleton instance of LocalStorage and ensures that only one instance is created. If the instance already exists, it returns the existing instance

@template T = any
The type of the value stored in local storage. Defaults to any

@returns LocalStorage<T>

API

function localStorage<T = any>(): LocalStorage<T>;

Example

import {localStorage} from '@bitfiber/rx';
 
const ls = localStorage();