React Native Cookbook by Jonathan Lebensold

React Native Cookbook by Jonathan Lebensold

Author:Jonathan Lebensold
Language: eng
Format: epub, mobi, pdf
Publisher: O'Reilly Media, Inc.
Published: 2018-03-01T05:00:00+00:00


Using Async/Await Instead of Promise()

Working with device hardware is rarely synchronous. In other words, the user interface will not block to wait until data from a sensor returns correctly. The result of this asynchronicity is often seen in a series of nested then( () => {}) statements. In order to get around this, I’ve decided to present this example using async and await. If you feel more comfortable with chaining then() instead, the examples should work just the same.

Figure 4-3. Delaying hardware device permissions provides users with a better user experience



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.