Skip to content

Instantly share code, notes, and snippets.

@njwest
Created March 24, 2018 13:12
Show Gist options
  • Save njwest/26b7c0566e181fe8832080e423bf5a09 to your computer and use it in GitHub Desktop.
Save njwest/26b7c0566e181fe8832080e423bf5a09 to your computer and use it in GitHub Desktop.
services/deviceStorage.js
import { AsyncStorage } from 'react-native';
const deviceStorage = {
# code omitted for brevity
async deleteJWT() {
try{
await AsyncStorage.removeItem('id_token')
.then(
() => {
this.setState({
jwt: ''
})
}
);
} catch (error) {
console.log('AsyncStorage Error: ' + error.message);
}
}
};
export default deviceStorage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment