Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function loadResourcesAsync() {
await Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png')
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free to
// remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf')
})
]);
}
async function loadResourcesAsync() {
await Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free to
// remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
]);
}
async function loadResourcesAsync() {
await Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free to
// remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
]);
}
async function loadResourcesAsync() {
await Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
// We include SpaceMono because we use it in HomeScreen.js. Feel free to
// remove this if you are not using it in your app
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
}),
]);
}
(async () => {
try {
await Promise.all([
Font.loadAsync(Ionicons.font),
]);
} catch (e) {
console.log({ e });
} finally {
setLoaded(true);
}
})()
});
async _loadAssetsAsync() {
const imageAssets = this._cacheImages([
require('./assets/videoplayer/thumb.png'),
require('./assets/videoplayer/track.png'),
]);
const fontAssets = this._cacheFonts([
fonts,
EvilIcons.font,
FontAwesome.font,
Ionicons.font,
MaterialIcons.font,
Foundation.font,
]);
try {
await Promise.all([
Store.rehydrateAsync(),
...imageAssets,
...fontAssets,
]);
Store.dispatch({ type: 'SET_DATA', data: Data });
} catch (e) {
console.log('Error downloading assets', e);
Sentry.captureException(e);
}
componentWillMount() {
Font.loadAsync(Ionicons.font);
this.setState({ appLoaded: true });
ScreenTracker.setScreen('LiveGauge');
}
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
]),
Font.loadAsync([
Ionicons.font,
{ 'terminal': require('./assets/fonts/Inconsolata-Regular.ttf') },
]),
]);
};
async componentDidMount() {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
...Ionicons.font
})
this.setState({
isReady: true
})
}
endLoad,
} = this.props
if (!isLoaded && !isLoading) {
startLoad()
const imageAssets = cacheImages([
require('../../assets/images/all-games-wallpaper.png'),
require('../../assets/images/arrow.png'),
require('../../assets/images/arrows.png'),
require('../../assets/images/giantbomb-logo.png'),
require('../../assets/images/icon.png'),
])
const fontAssets = cacheFonts([
Ionicons.font,
MaterialCommunityIcons.font,
MaterialIcons.font,
Octicons.font,
{
'florentia-extralight': require('../../assets/fonts/florentia.extralight.ttf'),
'arista-pro-extralight': require('../../assets/fonts/arista-pro-extralight.ttf'),
'let-that-be-enough-regular': require('../../assets/fonts/let-that-be-enough.regular.ttf'),
}
])
await Promise.all([
...imageAssets,
...fontAssets,
])
endLoad()