Using dmx.app.set variables across pages?

I have a flow that runs the following javascript function:

function stripeSubscriptionGet(firebase_uid) {
return firebase.firestore()
	.collection('stripe_customers')
	.doc(firebase_uid)
	.collection('subscription')
	.onSnapshot(results => {
        const subscription_ids = results.docs.map(doc => doc.id);
        dmx.app.set('stripe_subscriptions', subscription_ids);
    });
}

The function calls Firestore and saves the results in a variable called stripe_subscriptions that I’d like to use across several pages. What is the best way for me to do that besides simply running the function on every page?

Have a loo at using one of the following: