@onebuy/util
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

@onebuy/util

TODO: description

Usage

import { StorageService } from '@onebuy/util';

enum EStorage {
  Role = 'role',
  User = 'user',
}

const storage = new StorageService<EStorage>({
  rootKey: 'onebuy'
});

storage.set(EStorage.Role, 'admin');
storage.get(EStorage.Role); // 'admin'

storage.set(EStorage.User, {
  name: 'Lucy',
  email: 'balabala@163.com'
});
storage.get(EStorage.User); // { name: 'Lucy', email: 'balabala@163.com' }

storage.remove(EStorage.User);
storage.get(EStorage.User); // undefined

使用UMD

<!-- 需要先导入 axios -->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js" type="text/javascript"></script>
<script src="onebuy-util@2.0.0.min.js" type="text/javascript"></script>

Readme

Keywords

none

Package Sidebar

Install

npm i @onebuy/util

Weekly Downloads

2

Version

2.0.3

License

ISC

Unpacked Size

22.5 kB

Total Files

13

Last publish

Collaborators

  • rccq17mj
  • guccihuiyuan