Check out example codes for "pub schedule firebase". It will help you in understanding the concepts better.

Code Example 1

import {EventContext} from 'firebase-functions';
// There is an allowance of three free jobs per Google account
//  For example, to run a function every five minutes with 
//  AppEngine cron.yaml syntax, do something like this:
export const scheduledFunction = 
      functions.pubsub.schedule('every 5 minutes').onRun(
          (context: EventContext) => {
            console.log('This will be run every 5 minutes!');
            return new Promise();

Learn ReactJs, React Native from