Github user jorgebay commented on the issue:

    https://github.com/apache/tinkerpop/pull/695
  
    > About `utils.toPromise` - if I understand you well, you want a dual 
callback/promise API for most async functions?
    
    Just promise-based API, no callback-based API. `utils.toPromise()` its a 
way to support different "promise factories", the way promises are created in 
the driver. It's an idea to support any `Promise` API (like bluebird), but it's 
not really needed... maybe adds unnecessary complexity to the code? Do you 
think it makes more sense to remove it?
    
    > In `graph-traversal.js`, most methods of `GraphTraversalSource` and 
`GraphTraversal` and function attached to `statics` [...]
    
    I like the idea of having the methods defined in code to support code 
completion on IDEs like VS Code and WebStorm, given that it's hard to remember 
all the traversal methods by heart. Maybe we can reduce the size and complexity 
of the generated code by using something like:
    
    Instead of (current):
    
    ```javascript
    const statics = {};
    statics.V = function (args) {
      const g = new GraphTraversal(null, null, new Bytecode());
      return g.V.apply(g, arguments);
    };
    statics.addE = function (args) {
      const g = new GraphTraversal(null, null, new Bytecode());
      return g.addE.apply(g, arguments);
    };
    ```
    
    Use:
    
    ```javascript
    const statics = {
      V: (...args) => callOnEmptyTraversal('V', args),
      addE: (...args) => callOnEmptyTraversal('addE', args),
      // ...
    };
    ```
    
    wdyt?
    
    I'll start working on the other suggestions (ES6).


---

Reply via email to