MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / cancellable

Function cancellable

01.GettingStarted/js/vue.js:368–378  ·  view source on GitHub ↗

* Make a cancellable version of an async callback. * * @param {Function} fn * @return {Function}

(fn)

Source from the content-addressed store, hash-verified

366 */
367
368 function cancellable(fn) {
369 var cb = function cb() {
370 if (!cb.cancelled) {
371 return fn.apply(this, arguments);
372 }
373 };
374 cb.cancel = function () {
375 cb.cancelled = true;
376 };
377 return cb;
378 }
379
380 /**
381 * Check if two values are loosely equal - that is,

Callers 1

vue.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected