@jswork/next-try-execute
v1.0.1
Published
Try execute a method on context.
Downloads
3
Maintainers
Readme
next-try-execute
Try execute a method on context.
installation
npm install -S @jswork/next-try-execute
usage
import '@jswork/next-try-execute';
const someApi = {
deleted: false,
del: function (value) {
this.deleted = value;
},
delete: function (value) {
console.warn("delete is deprecated, use del instead");
this.del(value);
},
};
console.log(someApi.deleted); // false
nx.tryExecute(someApi, [], ["del", "delete"]);
console.log(someApi.deleted); // undefined
license
Code released under the MIT license.