- promiseTracker: upgrade to angular 1.3 (faf1eb01)
- promiseTracker: add tracker.tracking() method (87776e54)
The API has completely changed in 2.0. See the README for details. Synopsis of changes:
- String ID system for trackers removed, now use instances created with
var myTrack = new promiseTracker(options);
. - http interceptor functionality is now optional; use it by including
promise-tracker-http-interceptor.js
- maxDuration option is removed (there are better ways to do this in every case)
If you are using 1.x in your app and you would like to upgrade, here is the migration guide:
- Find your string ids where you are getting promiseTracker with
promiseTracker('id')
, and create a reference instead withpromiseTracker()
. If you want a global tracker, store it on rootScope or in a service (check README). - (note: The actual instances of the promiseTrackers will have the same API).
Upgrading is not required, or even recommended, for existing apps.
- promiseTracker: add
activationDelay
option (see documentation in README.md)
- support angular-1.2 ngResource)
- Note: Use of angular-1.0.x and angular-1.1.x are now deprecated. They will be removed in the next version.
- fix closure problem (437b4623)
- fix error in ie8 (92d72f2c)
- allow array of tracker names in http tracker option (66d41cdd)
- Fix error with minified files (f8ee34e8)
- Introduce grunt-conventional-changelog (f8b7d23)
Change name of module to ajoslin.promise-tracker
- Follows AngularJS component spec.
- To migrate, just change the name of the module included. For example:
angular.module('myApp', ['ajoslin.promise-tracker']);
Add support for angular-resource
var Books = new $resource('/books');
var bookList = Books.get();
myTracker.addPromise(bookList);
- See more examples in the promiseTracker angular-resource tests.
Add cancel
method for a tracker
- When called,
myTracker.cancel()
will immediately turn the tracker inactive and fire all events.
Add a concept of options for trackers
-
Options can be set when the tracker is first created:
var myTracker = promiseTracker('super_track', { stressLevel: 0 });
-
All options also have setters:
myTracker.setStressLevel(0);
Add minDuration
option
- Passed in with
minDuration
key in options, or set withsetMinDuration
method on a tracker. - Makes it so when a tracker is activated, it will always stay up for at least the given milliseconds.
- For example, if I set minDuration to 1000 and give my tracker three promises that all resolve after 850ms, the tracker will stay active until 1000ms have expired.
Add maxDuration
option
- Passed in with
maxDuration
key in options, or set withsetMaxDuration
method on a tracker. - Makes it so a tracker will automatically deactivate itself after the given milliseconds of being active.
- For example, if I set maxDuration to 5000, no matter how long the promises I give my tracker wait to be resolved, the tracker will deactivate after 5000ms have expired.