i'm looking for a proper way to manage a function callback.
Consider this part of code which is a piece of a angularjs controller:

```
 function($scope, $routeParams, $location, sessionService) {
        sessionService.logout(function(){
            $location.path('/');
        });
    }

```

SessionService is a factory to manage session with login, logout ....
the logout function looks like to:

```
session.logout= function(o){
            console.log('logout')
            $cookieStore.remove('eeToken');
            o();
        };

```

The main of this code is to delete the session token and redirect to the home. The disturbing part is the `o();`. Is there a proper way to do this callback ?

thanks.