candlefinance / cache Goto Github PK
View Code? Open in Web Editor NEWA key/value store for React Native
Home Page: https://candle.fi
License: MIT License
A key/value store for React Native
Home Page: https://candle.fi
License: MIT License
I'm wondering why it requires iOS 15+ as PINCache min compatibility is iOS 12 ?
Is there any reason or it's only because your main app is compatible with iOS 15+ ?
When importing package using `import Storage from '@candlefinance/cache', I'm getting the following errors:
[TypeError: Cannot read property 'read' of undefined]
Property 'Storage' doesn't exist
Library works only when functions are imported like this:
import {read, write, remove} from '@candlefinance/cache';
I prefer the first way of importing because 'read', 'write' and 'remove' are commonly used function names, which results in duplicates.
byteLimit:50 * 1024 * 1024 // 50 MB by default
ageLimit:60 * 60 * 24 * 30]; // 30 days by default
Great library!
Only thing I am missing is the API compatibility with AsyncStorage for seamless replace.
For example, Supabase library expects storage object to have the following functions: removeItem
, setItem
and getItem
.
Workaround for now is to create a wrapper function like this:
const wrappedCacheStore = {
getItem: async (key: string) => {
return await read(key);
},
setItem: async (key: string, value: string) => {
await write(key, value);
},
removeItem: async (key: string) => {
await remove(key);
},
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.