ContainerInstanceCache Class addon/-private/system/store/container-instance-cache.js:5


PRIVATE

The ContainerInstanceCache serves as a lazy cache for looking up instances of serializers and adapters. It has some additional logic for finding the 'fallback' adapter or serializer.

The 'fallback' adapter or serializer is an adapter or serializer that is looked up when the preferred lookup fails. For example, say you try to look up adapter:post, but there is no entry (app/adapters/post.js in EmberCLI) for adapter:post in the registry.

The fallbacks array passed will then be used; the first entry in the fallbacks array that exists in the container will then be cached for adapter:post. So, the next time you look up adapter:post, you'll get the adapter:application instance (or whatever the fallback was if adapter:application doesn't exist).