Updated stateFlagTimeout to get the setTimeout function injected as a dependency

This commit is contained in:
Alejandro Celaya
2019-01-08 20:49:47 +01:00
parent 00d386f19f
commit 8b8be2d7ca
8 changed files with 26 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
import axios from 'axios';
import { stateFlagTimeout } from '../utils';
import Storage from './Storage';
import ColorGenerator from './ColorGenerator';
import buildShlinkApiClient from './ShlinkApiClientBuilder';
@@ -10,6 +11,9 @@ const provideServices = (bottle) => {
bottle.constant('axios', axios);
bottle.serviceFactory('buildShlinkApiClient', buildShlinkApiClient, 'axios');
bottle.constant('setTimeout', global.setTimeout);
bottle.serviceFactory('stateFlagTimeout', stateFlagTimeout, 'setTimeout');
};
export default provideServices;