We should be able to access props at _app.js level, it can be declared as
`
const { fetchMediaDataFromCMS } = require('./service/mediaData.service');
module.exports = () => ({
'/_app': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
});
`
Also, if same function is called by another page let's say
`const { fetchMediaDataFromCMS } = require('./service/mediaData.service');
module.exports = () => ({
'/2021/[id]': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
'/2022/[id]': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
'/_app': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
});
`
then, it should load the data for other pages from cache of the library, should not call the same function to evaluate again and again.
We should be able to access props at _app.js level, it can be declared as
`
const { fetchMediaDataFromCMS } = require('./service/mediaData.service');
module.exports = () => ({
'/_app': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
});
`
Also, if same function is called by another page let's say
`const { fetchMediaDataFromCMS } = require('./service/mediaData.service');
module.exports = () => ({
'/2021/[id]': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
'/2022/[id]': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
'/_app': [{ key: 'mediaPosts', data: fetchMediaDataFromCMS }],
});
`
then, it should load the data for other pages from cache of the library, should not call the same function to evaluate again and again.