Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

not enough async documentation/tests - BUG #129

Closed
boxxxie opened this issue Mar 18, 2015 · 4 comments · Fixed by #130
Closed

not enough async documentation/tests - BUG #129

boxxxie opened this issue Mar 18, 2015 · 4 comments · Fixed by #130

Comments

@boxxxie
Copy link

boxxxie commented Mar 18, 2015

i'm trying to use promises with graph.add

var fs = require("q-io/fs");
 var graph = new shepherd.Graph();

  graph.add('config', function(){
    return fs.read("config.json").then(JSON.parse);
  });

  var builder = graph.newBuilder()
  .builds('config');

  builder
  .run({str: "Hello"})
  .then(function(data) {
    console.log(data);
  });

output

{ config: { state: 'pending' } }

i'm not sure why my promises aren't working with builds()

@nicks
Copy link
Contributor

nicks commented Mar 18, 2015

what result were you expecting?

@boxxxie
Copy link
Author

boxxxie commented Mar 18, 2015

i was expecting the promise to be resolved and for config to have the value of the resolution.
i was expecting what i would get via the callback style (which works)

  graph.add('cb-config', function(next){
    fs.read("config.json")
    .then(JSON.parse)
    .then(_.partial(next,null),next);
  });

@nicks
Copy link
Contributor

nicks commented Mar 18, 2015

hmmm...i see...something about the A+/promises interop isn't working correctly; we'll take a look, thanks for filing.

nicks pushed a commit that referenced this issue Mar 18, 2015
@boxxxie boxxxie changed the title not enough async documentation/tests not enough async documentation/tests - BUG Mar 18, 2015
@boxxxie
Copy link
Author

boxxxie commented Mar 18, 2015

wow, is this resolved?

nicks pushed a commit that referenced this issue Mar 18, 2015
nicks pushed a commit that referenced this issue Mar 18, 2015
nicks added a commit that referenced this issue Mar 18, 2015
Fix up Promises/A+ compliance. Fixes #129
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants