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 React, { Component } from 'react'; | |
import { | |
Platform, | |
StyleSheet, | |
Text, | |
ScrollView, | |
Button, | |
Image | |
} from 'react-native'; |
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 React, { Component } from 'react'; | |
import { | |
Platform, | |
StyleSheet, | |
Text, | |
ScrollView, | |
Button, | |
Image | |
} from 'react-native'; |
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
componentDidMount() { | |
BackgroundTask.schedule(); // Schedule the task to run every ~15 min if app is closed. | |
} |
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 BackgroundTask from 'react-native-background-task' | |
import queueFactory from 'react-native-queue'; | |
BackgroundTask.define(async () => { | |
// Init queue | |
queue = await queueFactory(); | |
// Register job worker | |
queue.addWorker('pre-fetch-image', async (id, payload) => { |
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 React, { Component } from 'react'; | |
import { | |
Platform, | |
StyleSheet, | |
Text, | |
ScrollView, | |
Button, | |
Image | |
} from 'react-native'; |
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
// https://github.com/billmalarky/react-native-queue | |
// https://github.com/devfd/react-native-workers | |
// ###################### | |
// From your application: | |
// ###################### | |
import queueFactory from 'react-native-queue'; | |
import { Worker } from 'react-native-workers'; | |
// Initialize queue and throw a few jobs on it |