josephg / node-foundationdb

Modern Node.js FoundationDB bindings
Other
116 stars 17 forks source link

TypeScript definition missing "cancel" method of Watch class. #16

Closed ryanworl closed 6 years ago

ryanworl commented 6 years ago

https://github.com/josephg/node-foundationdb/blob/16805ba862fc9688f232d6a881c4a2f939ecb033/src/future.cpp#L138-L147

This method is missing from the definition files. I think there was a copy and paste that replaced it with clear, but that is just speculation.

https://github.com/josephg/node-foundationdb/blob/6b94ba313136b3ef6908df59afa04b99e64da4ef/lib/native.ts#L16-L18

There is no functional difference, just the compiler complaining about it.

If I have time to set everything up I'll throw in a PR for it, otherwise just wanted to leave this here for anyone who is wondering where this method is.

josephg commented 6 years ago

Oh weird; this should have been caught by the unit tests. I'm confused why they're passing

josephg commented 6 years ago

... Right; the fuzzer doesn't actually test watches. We need unit tests for watch. Thanks for catching this.

josephg commented 6 years ago

Published in v0.5.0

josephg commented 6 years ago

... In v0.6.0 I totally gutted & rewrote the watch API. It uses promises now, and it has tests. I thought about supporting both promises and callbacks, but I think the code right now is simpler and more straight forward to use.

Documentation for the new watch API is in the readme