This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable prefer-promise-reject-errors */ | |
| export default class CancelablePromise { | |
| static pendingPromises = []; | |
| /** | |
| * Add new promise to the static array | |
| * @param {Promises} promise | |
| */ | |
| static appendPendingPromise(promise) { | |
| CancelablePromise.pendingPromises = [...CancelablePromise.pendingPromises, promise]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useEffect, useRef } from 'react'; | |
| import AsyncStorage from '@react-native-community/async-storage'; | |
| /** | |
| * Convert const Infinity to string to avoid the transformation to null | |
| * @param {*} key | |
| * @param {*} value | |
| */ | |
| function stringifyInfinity(key, value) { | |
| return value === Infinity ? 'Infinity' : value; |