typed-promisify icon indicating copy to clipboard operation
typed-promisify copied to clipboard

Optional callbacks

Open wclr opened this issue 8 years ago • 2 comments

  • callbacks should be optional (some nodejs methods has such API),
  • removed old typings deps, added deps from @types
  • improvements for running mocha tests without need to build ts
  • in npm should be published built version js+d.ts not ts source

wclr avatar Apr 08 '17 22:04 wclr

Hi @whitecolor, thanks for the improvements. It looks good, but a couple questions:

Can you help me understand the use case for optional callbacks? If it's for promisifying functions such as fs.close, I found the existing implementation works without any changes.

I haven't used typescript in a while, so I'm unfamiliar with the new @types system. I found I had to install @types/node to get the test to run. Can you take a look?

notenoughneon avatar Apr 15 '17 20:04 notenoughneon

Hm, you are probably right there is no need to make callbacks optional, I thought abou fs.exists, it turns to be deprecated inconsistent API.

I'm unfamiliar with the new @types system

Typescript 2.0 allows to use typings just from npm. https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types

Well yes it seem that there need to add @types/node in dev dependencies. I had them installed in node_modules not sure why =)

So probably should revert my changes on callbacks.

wclr avatar Apr 15 '17 22:04 wclr