I'd like to use Ngrx for OAuth2 services and I need to get current store state without using subscribe.
This is my OAuth function for getting token from localStorage:
private oAuth2() {
const token = JSON.parse(localStorage.getItem('oAuthToken'));
if (token && token.access_token) {
const headers = new Headers({ 'Authorization': 'Bearer ' + token.access_token });
return new RequestOptions({ headers: headers });
}
}
Is it possible to use Redux store instead of localStorage in this case?