@hylid/call
Advanced tools
Comparing version 4.0.0-alpha.6 to 4.0.0-alpha.7
export interface Options { | ||
success?: (res: any) => void; | ||
fail?: (res: any) => void; | ||
} | ||
export declare const promisify: <T extends Options, P = Parameters<Required<Options> & T["success"]>[0]>(fn: (opt: T) => void) => (args?: T | undefined) => Promise<P>; |
@@ -15,4 +15,12 @@ var __assign = this && this.__assign || function () { | ||
var options = __assign(__assign({}, args), { | ||
success: resolve, | ||
fail: reject | ||
success: function success(opt) { | ||
var _a; | ||
resolve(opt); | ||
(_a = args === null || args === void 0 ? void 0 : args.success) === null || _a === void 0 ? void 0 : _a.call(args, opt); | ||
}, | ||
fail: function fail(opt) { | ||
var _a; | ||
reject(opt); | ||
(_a = args === null || args === void 0 ? void 0 : args.fail) === null || _a === void 0 ? void 0 : _a.call(args, opt); | ||
} | ||
}); | ||
@@ -19,0 +27,0 @@ fn(options); |
{ | ||
"name": "@hylid/call", | ||
"version": "4.0.0-alpha.6", | ||
"version": "4.0.0-alpha.7", | ||
"main": "lib/index.js", | ||
@@ -9,4 +9,4 @@ "files": [ | ||
"dependencies": { | ||
"@hylid/env": "^4.0.0-alpha.6", | ||
"@hylid/types": "^4.0.0-alpha.6" | ||
"@hylid/env": "^4.0.0-alpha.7", | ||
"@hylid/types": "^4.0.0-alpha.7" | ||
}, | ||
@@ -13,0 +13,0 @@ "publishConfig": { |
33808
1058
Updated@hylid/env@^4.0.0-alpha.7
Updated@hylid/types@^4.0.0-alpha.7