Skip to content

a simplified function to reduce the consumption of get from storage

Notifications You must be signed in to change notification settings

fengtomy/cached-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

cached storage

It's simplified function to reduce the consumption of getting/setting data from storage, such as uni.getStorageSync, window.localStorage.getItem.

use case

Below are some use cases in case you're interested

import cachedStorage from 'cached-storage'
cachedStorage.init({
  env: 'uni', // 'window'
  context: 'uni', // window
})
// get
cachedStorage.getSync('key')
// set
cachedStorage.setSync('key', 'value')
// remove
cachedStorage.removeSync('key')
// clear
cachedStorage.clearSync()

limitation

Currently it only supports uni, and I'll try my best to support other platforms.
It now supports uni and browser(window), and I'll try my best to support other major platforms.

About

a simplified function to reduce the consumption of get from storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published