tardyp/buildbot — pull request #2 by tothandras (2014-03-24 18:21:59+00:00)
Title: Update recent storage service

# recentStorage
The service provides methods for adding, retrieving and clearing recently viewed builders and builds.
It uses IndexedDB to store data inside the user’s browser. You can see the list of supported browsers [here](http://caniuse.com/indexeddb).
# Usage
```coffee
angular.module('app').controller 'sampleController',
['$scope', 'recentStorage'
($scope, recentStorage) ->
$scope.builds = []
recentStorage.getBuilds().then (e) ->
$scope.builds = e
# ...
]
```
# Builder and Build object properties
| Property | Type | Description |
| ------------- | ------------- | ------------- |
| link | string | This specifies the build’s or builder’s link. |
| caption | string | This specifies the build’s or builder’s shown caption. |
### Sample
```coffee
{
link: '/builders/1',
caption: 'Mac'
}
```
# Methods
## addBuild(build)
### Return
Promise
### Parameters
| Parameter | Type |
| ------------- | ------------- |
| build | Build |
### Sample
```coffee
build = {
link: '/builders/1/build/1',
caption: 'Mac - test build'
}
recentStorage.addBuild(build)
```
## addBuilder(builder)
### Return
Promise
### Parameters
| Parameter | Type |
| ------------- | ------------- |
| builder | Builder |
### Sample
```coffee
builder = {
link: '/builders/1',
caption: 'Mac'
}
recentStorage.addBuilder(builder)
```
## getBuilds()
### Return
Promise
### Sample
```coffee
recentStorage.getBuilds().then (e) ->
$scope.builds = e
```
## getBuilders()
### Return
Promise
### Sample
```coffee
recentStorage.getBuilders().then (e) ->
$scope.builders = e
```
## getAll()
### Return
Promise
### Sample
```coffee
recentStorage.getAll().then (e) ->
$scope.builds = e.recent_builds
$scope.builds = e.recent_builders
```
## clearAll()
### Return
Promise
### Sample
```coffee
recentStorage.clearAll()
```