1.0.7 • Published 3 years ago

storage-timing v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

StorageTiming doc

language: 中文文档

Introduction

StorageTiming is used to manage localStorage and sessionStorage, and can set timing for them.

Installation

npm install --save storage-timing
# or
yarn add storage-timing

Usage

import { Store } from "storage-timing";

const store = new Store();
const token = store.atom("token");
const foo = store.atom("foo");

token.set({ code: "bar" });
token.get(); // { code: "bar" }

token.remove();
token.get(); // null

// set timing. Expires after one hour, `foo.get()` returns "content" within one hour and null after one hour.
foo.set("content", Date.now() + 3600 * 1000);

Other

Welcome to the community to translate according to the Chinese document

Quote

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago