Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Cache {
- name: string
- }
- class MemoryCache implements Cache {
- name= "memory"
- }
- // Does not implement Cache interface
- class DiskCache {}
- interface CacheProvider {
- getCache: () => Cache
- }
- // Does not error because DiskCache isn't a valid Cache implementation ?!?!
- class LocalCacheProvider implements CacheProvider {
- getCache() {
- return DiskCache;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement