2019-08-31 20:51:14 -07:00

15 lines
474 B
TypeScript

import ApplicationInstance from '@ember/application/instance';
import { setCacheEnabled } from '@datahub/utils/api/fetcher';
/**
* Will set the cache based on the env of the application which this addon is running
*/
export function initialize(appInstance: ApplicationInstance): void {
const config = appInstance.resolveRegistration('config:environment') as Record<string, unknown>;
setCacheEnabled(config.environment !== 'test');
}
export default {
initialize
};