This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/api/token.js

17 lines
421 B
JavaScript
Raw Permalink Normal View History

2016-02-06 12:42:19 +00:00
import { AsyncStorage } from 'react-native';
2016-05-05 18:25:45 +01:00
import settings from '../settings/constants';
2016-02-06 12:42:19 +00:00
2016-02-14 19:19:11 +00:00
async function get() {
2016-05-05 18:25:45 +01:00
return await AsyncStorage.getItem(settings.get('STORAGE_KEY'));
2016-02-06 12:42:19 +00:00
}
2016-02-14 19:19:11 +00:00
async function set(token) {
2016-05-05 18:25:45 +01:00
return await AsyncStorage.setItem(settings.get('STORAGE_KEY'), token);
2016-02-06 12:42:19 +00:00
}
2016-02-14 19:19:11 +00:00
2016-05-07 19:32:59 +01:00
async function clear() {
return await AsyncStorage.removeItem(settings.get('STORAGE_KEY'));
}
export default { get, set, clear };