Sha256: 2c64e26dbd17f4c5ee9e017a098cda40e5eb2234a89cfeb46287f6378b74a66a
Contents?: true
Size: 497 Bytes
Versions: 91
Compression:
Stored size: 497 Bytes
Contents
// API module.exports = abort; /** * Aborts leftover active jobs * * @param {object} state - current state object */ function abort(state) { Object.keys(state.jobs).forEach(clean.bind(state)); // reset leftover jobs state.jobs = {}; } /** * Cleans up leftover job by invoking abort function for the provided job id * * @this state * @param {string|number} key - job id to abort */ function clean(key) { if (typeof this.jobs[key] == 'function') { this.jobs[key](); } }
Version data entries
91 entries across 89 versions & 22 rubygems