@jswork/next-try-execute

1.0.1 • Public • Published

next-try-execute

Try execute a method on context.

version license size download

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.

Package Sidebar

Install

npm i @jswork/next-try-execute

Homepage

js.work

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.15 kB

Total Files

5

Last publish

Collaborators

  • afeiship