1.0.7 • Published 2 years ago

storage-timing v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago