Skip to content

Commit f380055

Browse files
nrsandholmmportuga
authored andcommitted
feat(saveState): change restore() to return Promise created by refresh() (#6178)
* feat(saveState): change restore() to return Promise created by refresh() * feat(saveState): fix style (ngdocs)
1 parent 21819c5 commit f380055

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/features/saveState/js/saveState.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@
8484
* @description Restores the provided state into the grid
8585
* @param {scope} $scope a scope that we can broadcast on
8686
* @param {object} state the state that should be restored into the grid
87+
* @returns {object} the promise created by refresh
8788
*/
8889
restore: function ( $scope, state) {
89-
service.restore(grid, $scope, state);
90+
return service.restore(grid, $scope, state);
9091
}
9192
}
9293
}
@@ -302,6 +303,7 @@
302303
* @param {Grid} grid the grid whose state we'd like to restore
303304
* @param {scope} $scope a scope that we can broadcast on
304305
* @param {object} state the state we'd like to restore
306+
* @returns {object} the promise created by refresh
305307
*/
306308
restore: function( grid, $scope, state ){
307309
if ( state.columns ) {
@@ -328,7 +330,7 @@
328330
service.restorePagination( grid, state.pagination );
329331
}
330332

331-
grid.refresh();
333+
return grid.refresh();
332334
},
333335

334336

0 commit comments

Comments
 (0)