I have the following function:
export function request(
searchKey,
apiEndpoint,
path,
params,
{ additionalHeaders } = {}
) {
const method = "POST";
return _request(method, searchKey, apiEndpoint, path, params, {
additionalHeaders
}).then(response => {
return response
.json()
.then(json => {
var my_json = update(params)
const result = { response: response, json: json };
return result;
})
});
}
I want to export the variable my_json to another .js file. I already tried with export { my_json }, but it only works if I do that on the top of the document, which doesn't work in my case. Does anyone have an idea?