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

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/asynckit/lib/abort.js