Skip to content

Commit 2d9edfc

Browse files
committed
removing async_start
1 parent 40ccea8 commit 2d9edfc

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/components/App.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
import {withRouter} from 'react-router-dom'
3-
import {google_analytics, request, async_start} from '../utils'
3+
import {google_analytics, request} from '../utils'
44
import Error from './shared/Error'
55
import Contractors from './contractors/Contractors'
66
import PlainEnquiry from './enquiry/PlainEnquiry'
@@ -17,9 +17,6 @@ class App extends Component {
1717
}
1818
this.url = props.url_generator
1919

20-
this.get_enquiry = this.get_enquiry.bind(this)
21-
this.set_enquiry = this.set_enquiry.bind(this)
22-
2320
this.ga_event = this.ga_event.bind(this)
2421
this.request = request.bind(this)
2522
this.requests = {
@@ -39,7 +36,7 @@ class App extends Component {
3936

4037
get_enquiry () {
4138
if (this.state.enquiry_form_info === null) {
42-
async_start(this.set_enquiry)
39+
this.set_enquiry()
4340
}
4441
return this.state.enquiry_form_info || {}
4542
}

src/components/contractors/Contractors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
import {Link, Route} from 'react-router-dom'
3-
import {async_start, slugify} from '../../utils'
3+
import {slugify} from '../../utils'
44
import {If} from '../shared/Tools'
55
import {Grid, List} from './List'
66
import ConModal from './ConModal'
@@ -105,7 +105,7 @@ class Contractors extends Component {
105105
const state_ref = 'con_extra_' + con.id
106106
const con_extra = this.state[state_ref]
107107
if (con_extra === undefined) {
108-
async_start(this.set_contractor_details, con.url, state_ref)
108+
this.set_contractor_details(con.url, state_ref)
109109
}
110110
return con_extra
111111
}

src/utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ export function request (method, path, config) {
172172
})
173173
}
174174

175-
export const async_start = (f, ...args) => setTimeout(async () => f(...args), 0)
176-
177175
export const slugify = text => (
178176
text
179177
.toLowerCase()

0 commit comments

Comments
 (0)