This file contains 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
export default function fetchWithTimeout(url, options, timeout = 3000) { | |
const controller = new AbortController() | |
const { signal } = controller | |
setTimeout(() => controller.abort(), timeout) | |
return fetch(url, { ...options, signal }) | |
} |
This file contains 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
/** | |
* Small debounce function. | |
* | |
* by Christian C. Salvadó <[email protected]> | |
* MIT Style license, 2019 | |
*/ | |
function debounce(fn, ms = 0) { | |
let timer = 0 |
This file contains 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
function getCurrentPosition(options) { | |
return new Promise(function(resolve, reject) { | |
navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
}); | |
} | |
(async () => { | |
const position = await getCurrentPosition().catch(err => console.log(err)); | |
console.log(position); | |
})(); |
This file contains 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 _ from "lodash"; | |
import React from 'react'; | |
import moment from 'moment'; | |
import { connect } from 'react-redux'; | |
import API from '@Services/Api/profile'; | |
import { ApiManager } from "../../api/apiManager"; | |
import ParsedText from 'react-native-parsed-text'; | |
import { NavigationEvents } from "react-navigation"; | |
import { DateToWordsFromNow } from '../../helpers/helper'; | |
import { ACTIVITY_NOTIFICATION } from "../../api/constants"; |
This file contains 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 _ from "lodash" | |
import React from "react" | |
import moment from "moment" | |
import { connect } from "react-redux" | |
import API from "@Services/Api/profile" | |
import { ApiManager } from "../../api/apiManager" | |
import ParsedText from "react-native-parsed-text" | |
import { NavigationEvents } from "react-navigation" | |
import { DateToWordsFromNow } from "../../helpers/helper" | |
import { ACTIVITY_NOTIFICATION } from "../../api/constants" |
OlderNewer