dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.
https://agent-js.icp.xyz
Apache License 2.0
151 stars 93 forks source link

feat: make `IdbStorage` `get/set` methods generic #869

Closed hpeebles closed 5 months ago

hpeebles commented 5 months ago

Description

IdbStorage is a fairly lightweight wrapper around IdbKeyVal. IdbKeyVal exposes generic get and set methods whereas IdbStorage can only get and set strings. This seems like an unnecessary restriction and means developers must come up with hacky solutions to work with types other than strings, eg. CryptoKeyPair.

How Has This Been Tested?

I have tested this with a local deployment of OpenChat where it has successfully stored and retrieved values of type string and CryptoKeyPair.

Checklist: