Considering the example in the documentation, can someone please tell me where the event bus needs to be created?
// Where does this go?
const notificationEvents = new Framework7.Events();
//This in receiving part of app
notificationEvents.on('notificationReceived', function (notification) {
// do something with notification
})
//This in sending part of app
notificationEvents.emit('notificationReceived', {
title: 'New message',
from: 'John Doe',
});
I usually put custom code like yours, initialization or other helper functions in app-methods.js and include that right after Framework7 scripts at the end of the body: