UNPKG

@vtex/api

Version:
14 lines (13 loc) 428 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cancel = void 0; function cancel(middleware) { return async (ctx, next) => { var _a, _b; if ((_b = (_a = ctx.vtex) === null || _a === void 0 ? void 0 : _a.cancellation) === null || _b === void 0 ? void 0 : _b.cancelled) { return; } await middleware(ctx, next); }; } exports.cancel = cancel;