I am trying to build a Pusher-driven app (Angular + node.js). I am holding an in-memory db (array of objects that are subject to CRUD). What would be the good practice to send the list of objects/ids to a new user?
Say, I have initialization in server.js (node)
let pusher = new Pusher({
appId: process.env.PUSHER_APP_ID,
key: process.env.PUSHER_APP_KEY,
secret: process.env.PUSHER_APP_SECRET,
encrypted: process.env.PUSHER_APP_SECURE === 1,
cluster: process.env.PUSHER_APP_CLUSTER,
});
pusher... // `connection` doesn't exist here yet
So, the question can basically be rephrased to: what is the equivalent of socket.io's
io.on('connection', socket => {
// send objects here
});