Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function setSamplesInContainer() {
// add sample recipes to container
Container.set({
id: "SAMPLE_RECIPES",
transient: true, // create a fresh copy for each `get` of samples
factory: () => {
console.log("sampleRecipes copy created!");
return sampleRecipes.slice();
},
});
}
(async () => {
initGa();
await syncStorageService.init();
await localStorageService.init();
await localeService.init();
Container.set(ILocalStorageService, localStorageService);
Container.set(ISyncStorageService, syncStorageService);
Container.get(IConfigService).load();
Container.get(IPowerpackService).startup();
const app = dva({
namespacePrefixWarning: false,
history: createHashHistory(),
onError: e => {
(e as any).preventDefault();
message.destroy();
message.error(e.message);
},
});
app.use(createLoading());
if (config.createLogger) {
app.use(
createLogger({
predicate: (_: Function, { type }: Action) => {
(async () => {
initGa();
await syncStorageService.init();
await localStorageService.init();
await localeService.init();
Container.set(ILocalStorageService, localStorageService);
Container.set(ISyncStorageService, syncStorageService);
Container.get(IConfigService).load();
Container.get(IPowerpackService).startup();
const app = dva({
namespacePrefixWarning: false,
history: createHashHistory(),
onError: e => {
(e as any).preventDefault();
message.destroy();
message.error(e.message);
},
});
app.use(createLoading());
if (config.createLogger) {
app.use(
createLogger({