A
A
Alexander2017-03-22 16:59:03
JavaScript
Alexander, 2017-03-22 16:59:03

How to rewrite require in import?

require( 'google-client-api' )( function( gapi ) { /lalala}

Subject. What is the correct way to rewrite this code in import/export format?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav Kilin, 2017-03-22
@aleksand44

import googleClientApi from 'google-client-api'

googleClientApi(function (gapi) { /* lalala */ })

L
Leo Developer, 2017-03-22
@crazy_leo

export  function API () {}
import googleApi from "google-client-api"

// Output
googleApi => function (gapi) {/lalala}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question