Aller au contenu principal

@w5s/global-storage

W5S Time manipulation (@w5s/time)

NPM Version License

Installation

npm install @w5s/time

Usage

import { Time, TimeDuration } from '@w5s/time';
import { Task } from '@w5s/task';

export function nowPlusTwoMinutes() {
return Task.map(Time.now(), (currentTime) => Time['+'](currentTime, TimeDuration({ minutes: 2 })));
}

License

MIT © Julien Polo julien.polo@gmail.com

Index

Variables

const$storage

$storage: typeof $storage = ...

Symbol for property hosting storage

constglobalStorage

globalStorage: Storage = ...

Storage linked to globalThis. This storage is persistent through hot module reload and shared across modules.

@example
const key = Symbol('someKey');
if (!globalStorage.has(key)) {
globalStorage.set(key, ['foo', 'bar']);
}
globalStorage.get();// ['foo', 'bar']
Page Options