Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mkFetchTriggers = client => () =>
client.query(triggersConn.query(client), { as: triggersConn.as })
const addFetchTriggers = Component => {
async checkToLaunchJobs() {
const client = this.client
let triggers
const triggersFromState = client.getQueryFromState(triggersConn.as)
if (triggersFromState) {
triggers = triggersFromState.data
} else {
triggers = (await client.query(triggersConn.query(client))).data
}
for (const launchOpts of this.options.launchTriggers || []) {
await this.checkToLaunchJob(triggers, launchOpts)
}
}