convoyinc / apollo-cache-hermes

A cache implementation for Apollo Client, tuned for performance
Other
483 stars 30 forks source link

Runtime type check for cache configuration #220

Open yuit opened 6 years ago

yuit commented 6 years ago

With TypeScript, type checker helps catching lots of mistake. However, when using using Hermes in JS codebase, I think it will be valuable to provide some runtime check for correct type for cache config.

One possible option to do so (https://github.com/rbuckton/reflect-metadata)

nevir commented 6 years ago

I think we should start with explicit checks on the public surface area - the downside of reflect-metadata is that it only exposes the raw JS types (like Object, or Function, but nothing more nuanced than that)