We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I just added the abort method on the returned object of oboeWrapper. This is useful to abort the streaming.
abort
oboeWrapper
function oboeWrapper(params) { var stream = oboe(params); var singleArgMethods = ['start', 'done', 'fail']; var on = function (event, pattern, callback) { var wrappedCallback = function () { var args = arguments; return $rootScope.$evalAsync(function () { return callback.apply(stream, args); }); }; return singleArgMethods.indexOf(event) >= 0 ? stream.on(event, wrappedCallback) : stream.on(event, pattern, wrappedCallback); }; return { start: function (callback) { return on('start', null, callback); }, node: function (pattern, callback) { return on('node', pattern, callback); }, path: function (pattern, callback) { return on('path', pattern, callback); }, success: function (callback) { return on('done', null, callback); }, done: function (callback) { return on('done', null, callback); }, error: function (callback) { return on('fail', null, callback); }, fail: function (callback) { return on('fail', null, callback); }, abort: function() { stream.abort(); } }; }
To use it:
angular.module('app', ['ng-oboe']).controller('controller', function($scope) { $scope.stream; $scope.init = () => $scope.stream = oboe.get('/my-stream').node('!.*', (node) => console.log(node)); $scope.close = () => $scope.stream.abort(); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I just added the
abort
method on the returned object ofoboeWrapper
.This is useful to abort the streaming.
To use it:
The text was updated successfully, but these errors were encountered: