Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return polygoat(done => {
if (id) return done(null, id)
AsyncStorage.getItem('__uniqueId', (error, data) => {
if (error || !data) {
const generatedId = generate()
AsyncStorage.setItem('__uniqueId', generatedId, error => {
if (error) return done(error)
id = generatedId
done(null, id)
})
} else {
id = data
done(null, id)
}
})
}, callback)
}