Skip to content
This repository was archived by the owner on Sep 14, 2021. It is now read-only.

@google-cloud/prediction v0.3.0

Choose a tag to compare

@lukesneeringer lukesneeringer released this 26 Oct 03:47
· 65 commits to master since this release

release level

⚠️ Breaking Changes

Promises have arrived!

Issue: #551
PR: #1708

It's been a long time coming, but we're finally here. We've shipped promise support in the Google Cloud Prediction module!

Do I have to use promises?

Nope, carry on. (But keep reading if you use streams)

How do I use promises?

Don't pass a callback:

var prediction = require('@google-cloud/prediction')();

prediction.getModels()
  .then(function(data) {
    var models = data[0];
  })
  .catch(function(err) {});
How do I use a method as a stream?

All of the streaming functionality from our methods have been moved to their own method.

var prediction = require('@google-cloud/prediction')();

- prediction.getModels()
+ prediction.getModelsStream()
   .on('data', function(model) {})