I have a javascript object that each attribute is a function:
{
SetBtcPrice: {
key: 'SetBtcPrice',
options: { repeat: [Object], backoff: [Object], attempts: 10 },
handle: [AsyncFunction: handle]
},
SetVenezuelanRate: {
key: 'SetVenezuelaRate',
options: { repeat: [Object], backoff: [Object], attempts: 10 },
handle: [AsyncFunction: handle]
}
}
I'm exporting it as export default { SetBtcPrice, SetVenezuelanRate };
and I'm importing it in another file as import ExchangeRates from "./exchangeRates";
Then in this file I'm exporting the ExchangeRates
and another funtion:
exchangeRates.js:
import SetBtcPrice from "./SetBtcPrice";
import SetVenezuelanRate from "./SetVenezuelaRate";
export default { SetBtcPrice, SetVenezuelanRate };
jobs/index.js:
export { default as UserRegistrationMail } from "./UserRegistrationMail";
import ExchangeRates from "./exchangeRates";
export { ExchangeRates };
In another file I'm importing import * as jobs from "../jobs";
, this gives me:
{
UserRegistrationMail: [Getter],
ExchangeRates: {
SetBtcPrice: {
key: 'SetBtcPrice',
options: [Object],
handle: [AsyncFunction: handle]
},
SetVenezuelanRate: {
key: 'SetVenezuelaRate',
options: [Object],
handle: [AsyncFunction: handle]
}
}
}
How can I deconstruct the ExchangeRates
object, so when importing * as jobs
it gives me this:
{
UserRegistrationMail: [Getter],
SetBtcPrice: {
key: 'SetBtcPrice',
options: [Object],
handle: [AsyncFunction: handle]
},
SetVenezuelanRate: {
key: 'SetVenezuelaRate',
options: [Object],
handle: [AsyncFunction: handle]
}
}