Start a new topic

HTML5 livestream subscription - javascript error finally is not a function (kinvey-html5-sdk-3.2.0.min.js)

Hi,


When trying the livestream subscription in javascript, 

  

    listen: function(collectionname,cb) {
        // Here we assume that the "Bus" collection is enabled for live updates
        var store = Kinvey.DataStore.collection(collectionname);
        var subscription = store.liveStream.subscribe(function onNext(data) {
          // Called when new data is available.
          // This is where you should write code to act on new data
          console.log(data);
          cb(null,data);
        }, function onError(error) {
          // Called on errors
          console.log(error);
          cb(error,null);
        }, function onComplete() {
          // Called when the stream completes
          console.log('complete');
        });
    }

  

I am getting the following error:

Uncaught (in promise) TypeError: _utils.KinveyObservable.create(...).finally is not a function(…)

 When looking at Kinvey's SDK, and removing below part of the code, it worked

.finally(function () {
             source.close();
             delete _this8._liveStream;
           });

 Any idea if this is a bug or whether I am doing something wrong?

1 Comment

Yann,

Was this working with an earlier version of the SDK?

Thanks,
Pranav
Kinvey Support

 

Login or Signup to post a comment