Git Product home page Git Product logo

cache's People

Contributors

candle-admin avatar gtokman avatar huextrat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

huextrat

cache's Issues

Question: why it's iOS 15+ only ?

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+ ?

Property 'Storage' doesn't exist and [TypeError: Cannot read property 'read' of undefined]

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.

Make API compatible with AsyncStorage

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);
  },
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.