🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more →
Socket
Book a DemoInstallSign in
Socket

@tauri-apps/curriedforage

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tauri-apps/curriedforage

enhanced localForage with curry and crypto - for any browser and device

latest
Source
npmnpm
Version
1.0.0-alpha.8
Version published
Maintainers
4
Created
Source

curriedForage

forage

localForage is great, but operations with it can be tedious, and currying is a fun exercise.

Internally, we are using the same API as localForage, with the exception of the dropInstance interface, which, while still available, has been split out into three distinct calls. Also, are using .then instead of the callback approach, and always catch an error.

Of note are the extensions to the generic interface:

  • mergeItem (with a number of merge strategies available)
  • getKeyValue
  • deleteItemKey
  • hasKey
  • hasKeyValue

Even if undefined is saved, null will be returned by getItem(). This is due to a limitation in localStorage, and for compatibility reasons localForage cannot store the value undefined.

Process

  • forage.config({object})
  • forage.ready()
  • forage.set('user', { age: 12 })
  • forage.get('user')
  • forage.clear()

Usage

  • Exactly the same interface as localForage
  • With a currying function applied to the result
  • Modify the value returned (with or without curry)
  • Define error suppression

cryptoForage

Development

Testing

Tests are written with Jasmine flavor using Jest.

Docs

the docs are available as a static site in /docs

License

:copy: 2020 - Daniel Thompson-Yvetot and contributors

MIT

FAQs

Package last updated on 24 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts