Skip to content

Commit

Permalink
feat(saveState): change restore() to return Promise created by refres…
Browse files Browse the repository at this point in the history
…h() (#6178)

* feat(saveState): change restore() to return Promise created by refresh()

* feat(saveState): fix style (ngdocs)
  • Loading branch information
nrsandholm authored and mportuga committed Jun 6, 2017
1 parent 21819c5 commit f380055
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/features/saveState/js/saveState.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@
* @description Restores the provided state into the grid
* @param {scope} $scope a scope that we can broadcast on
* @param {object} state the state that should be restored into the grid
* @returns {object} the promise created by refresh
*/
restore: function ( $scope, state) {
service.restore(grid, $scope, state);
return service.restore(grid, $scope, state);
}
}
}
Expand Down Expand Up @@ -302,6 +303,7 @@
* @param {Grid} grid the grid whose state we'd like to restore
* @param {scope} $scope a scope that we can broadcast on
* @param {object} state the state we'd like to restore
* @returns {object} the promise created by refresh
*/
restore: function( grid, $scope, state ){
if ( state.columns ) {
Expand All @@ -328,7 +330,7 @@
service.restorePagination( grid, state.pagination );
}

grid.refresh();
return grid.refresh();
},


Expand Down

0 comments on commit f380055

Please sign in to comment.