S
S
Sergey2018-12-11 12:14:19
React Native
Sergey, 2018-12-11 12:14:19

React native async storage how to work with async?

Actually how to retrieve data from storage without asynchrony. Method AsyncStorage.getItem('key') - returns a promise. And how to work with it if I need to check the value without a promise and without a callback? Right away, because I'm working inside the formation of a request in the axios interceptor. Or am I doing something wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick, 2018-12-20
@DragonSpirit

Judging by the github, interceptors are good at making promises. If it's not convenient to work with .then, use the async/await approach.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question