Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function* tokenCheck() {
- const tokenStr = yield call(AsyncStorage.getItem, '@token');
- if (!tokenStr) return null;
- const token = JSON.parse(tokenStr);
- if (token) {
- const { user } = yield call(ApiService.getUser, token.access_token);
- yield all([
- put(tokenCreators.setToken(token)),
- put(userCreators.setUser(user)),
- ]);
- }
- return token;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement