vanadium / issues

Vanadium issue tracker
1 stars 1 forks source link

Syncbase JS: missing promise-based API #884

Open asadovsky opened 8 years ago

asadovsky commented 8 years ago

(from Syncbase usability fixit)

@AsturaPhoenix pointed out that unlike the rest of the Vanadium JS libraries, the Syncbase JS library does not include a Promise-based API. This issue is low-priority since we are currently focused on Java and Dart (JS has been sidelined for now), but if/when we revisit the JS API, we should ensure that the Syncbase API is consistent with the rest of the Vanadium APIs.

asadovsky commented 8 years ago

Assigning to Ali, cc-ing @nlacasse and @bjornick. I'm guessing we won't touch this for now since JS is not our main focus at this time. However, I agree with Ross that the Vanadium JS APIs ought to be consistent.

nlacasse commented 8 years ago

Rather than adding a promise-based API to Syncbase JS, I think we should remove the promise-based API from the rest of Vanadium JS libraries. (Or, switch everything to a promise-based API and lose callbacks.)

Maintaining both promise- and callback- APIs adds a lot of complexity and tests.

There are libraries like promisify (and callbackify) that developers can use to wrap our API if they would prefer promises (or callbacks).

asadovsky commented 8 years ago

SGTM. In Java we went that route as well - we picked one way of doing things for the core impl and APIs, and made sure that it's easy for developers to wrap that if they desire the alternative model.