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

@@ -2,12 +2,11 @@ import { assoc, dissoc, pipe } from 'ramda';
import React from 'react';
import { v4 as uuid } from 'uuid';
import PropTypes from 'prop-types';
import { stateFlagTimeout } from '../utils/utils';
import './CreateServer.scss';
const SHOW_IMPORT_MSG_TIME = 4000;
const CreateServer = (ImportServersBtn) => class CreateServer extends React.Component {
const CreateServer = (ImportServersBtn, stateFlagTimeout) => class CreateServer extends React.Component {
static propTypes = {
createServer: PropTypes.func,
history: PropTypes.shape({

View File

@@ -12,7 +12,7 @@ import ServersExporter from './ServersExporter';
const provideServices = (bottle, connect, withRouter) => {
// Components
bottle.serviceFactory('CreateServer', CreateServer, 'ImportServersBtn');
bottle.serviceFactory('CreateServer', CreateServer, 'ImportServersBtn', 'stateFlagTimeout');
bottle.decorator('CreateServer', connect([ 'selectedServer' ], [ 'createServer', 'resetSelectedServer' ]));
bottle.serviceFactory('ServersDropdown', ServersDropdown, 'ServersExporter');