diff --git a/README.md b/README.md index 8f6223e..6c8470d 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@
-![Build Status](https://github.com/GavinBirkhoff/local-store-pro/actions/workflows/node-ci.yml/badge.svg) -[![codecov](https://codecov.io/github/GavinBirkhoff/local-store-pro/branch/main/graph/badge.svg)](https://codecov.io/github/GavinBirkhoff/local-store-pro) -![license](https://img.shields.io/github/license/gavinbirkhoff/local-store-pro) -![release](https://img.shields.io/github/release/gavinbirkhoff/local-store-pro.svg) +![Build Status](https://github.com/GavinBirkhoff/storetify/actions/workflows/node-ci.yml/badge.svg) +[![codecov](https://codecov.io/github/GavinBirkhoff/storetify/branch/main/graph/badge.svg)](https://codecov.io/github/GavinBirkhoff/storetify) +![license](https://img.shields.io/github/license/gavinbirkhoff/storetify) +![release](https://img.shields.io/github/release/gavinbirkhoff/storetify.svg)
-English | [简体中文](https://github.com/GavinBirkhoff/local-store-pro/blob/main/README.zh-CN.md) +English | [简体中文](https://github.com/GavinBirkhoff/storetify/blob/main/README.zh-CN.md) The encapsulation of local storage localStorage, provides expiration time setting and subscription functions, provides simple API use, no dependencies, and the compression is only 3.71KB (gzipped: 1.37KB). @@ -23,13 +23,13 @@ The encapsulation of local storage localStorage, provides expiration time settin ```bash # npm install -npm install local-store-pro +npm install storetify # yarn install -yarn add local-store-pro +yarn add storetify #pnpm install -pnpm add local-store-pro +pnpm add storetify ``` ## 🏗️ Build @@ -46,22 +46,20 @@ npm test # 🔨 Usage -or manually download and include in your HTML **local-store-pro.min.js**,you can also pass [UNPKG](https://unpkg.com/local-store-pro/lib/) to download: +```js +import store from 'storetify'; +store("test","storetify"); +``` + +or manually download and include in your HTML **storetify.min.js**,you can also pass [UNPKG](https://unpkg.com/storetify/lib/) to download: ```html - + ``` -or - -```js -import store from 'local-store-pro'; -store("test","local-store-pro"); -``` - ## ⚙️ API ### set @@ -121,7 +119,7 @@ store.subscribe("test",(e)=>{}) For the event variable e, it is an abbreviated object from the StorageEvent object, which provides some practical properties, which can be used to observe the changes of key-value pairs well, as shown in the following table: ```ts -type NextStorageEventValue = Partial | any[] | null | string | number +type NextStorageEventValue = Record | any[] | null | string | number ``` | Property | Type | Description| diff --git a/README.zh-CN.md b/README.zh-CN.md index f7f8fc2..ce38c58 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,13 +1,13 @@
-![Build Status](https://github.com/GavinBirkhoff/local-store-pro/actions/workflows/node-ci.yml/badge.svg) -[![codecov](https://codecov.io/github/GavinBirkhoff/local-store-pro/branch/main/graph/badge.svg)](https://codecov.io/github/GavinBirkhoff/local-store-pro) -![license](https://img.shields.io/github/license/gavinbirkhoff/local-store-pro) -![release](https://img.shields.io/github/release/gavinbirkhoff/local-store-pro.svg) +![Build Status](https://github.com/GavinBirkhoff/storetify/actions/workflows/node-ci.yml/badge.svg) +[![codecov](https://codecov.io/github/GavinBirkhoff/storetify/branch/main/graph/badge.svg)](https://codecov.io/github/GavinBirkhoff/storetify) +![license](https://img.shields.io/github/license/gavinbirkhoff/storetify) +![release](https://img.shields.io/github/release/gavinbirkhoff/storetify.svg)
-[English](https://github.com/GavinBirkhoff/local-store-pro/blob/main/README.md) | 简体中文 +[English](https://github.com/GavinBirkhoff/storetify/blob/main/README.md) | 简体中文 🦄本地存储localStorage的封装,提供过期时间设置和订阅功能,提供简单API使用,没有依赖,压缩只有 3.81KB(gzipped: 1.39KB)。 @@ -23,13 +23,13 @@ ```bash # npm 安装 -npm install local-store-pro +npm install storetify # yarn 安装 -yarn add local-store-pro +yarn add storetify #pnpm 安装 -pnpm add local-store-pro +pnpm add storetify ``` ## 🏗️ 构建 @@ -46,22 +46,20 @@ npm test # 🔨 使用 -或者在您的HTML中手动下载并引入 **local-store-pro.min.js**,你也可以通过 [UNPKG](https://unpkg.com/local-store-pro/lib/) 进行下载: +```js +import store from 'storetify'; +store("test","storetify"); +``` + +或者在您的HTML中手动下载并引入 **storetify.min.js**,你也可以通过 [UNPKG](https://unpkg.com/storetify/lib/) 进行下载: ```html - + ``` -or - -```js -import store from 'local-store-pro'; -store("test","local-store-pro"); -``` - # ⚙️ API ### set @@ -121,7 +119,7 @@ store.subscribe("test",(e)=>{}) 对于事件变量e,是一个来自StorageEvent对象的简略对象,提供了一些实用的属性,可以很好的观察键值对的变化,如下表: ```ts -type NextStorageEventValue = Partial | any[] | null | string | number +type NextStorageEventValue = Record | any[] | null | string | number ``` | Property | Type | Description| diff --git a/example/index.html b/example/index.html index d1cb1ec..43d1fa2 100644 --- a/example/index.html +++ b/example/index.html @@ -11,9 +11,9 @@ - +