-
Notifications
You must be signed in to change notification settings - Fork 3
How does the board work in real time?
Ammar Tariq edited this page Nov 6, 2021
·
1 revision
-
addObjectListener()
listens for new posts added to canvas - Uses
sendObjectToGroup()
to store the post in Firebase
- In
ngOnInit()
, canvas gets attached to an observable which listens for newly-created posts from Firebase - When new posts are added,
handleAddFromGroup()
is invoked which parses the post and usessyncBoard()
to add the parsed post to the canvas
-
movingObjectListener()
listens for moving posts on canvas - Sends updated post to Firebase
- In
ngOnInit()
, canvas gets attached to an observable which listens for modified posts from Firebase - When posts are moved,
handleModificationFromGroup()
is invoked which parses the post and usessyncBoard()
to update the parsed post on the canvas
-
removeObjectListener()
listens for deleted posts on canvas - Once a post is deleted, it updates the post with a
removed
flag and sends it to Firebase
- In
ngOnInit()
, canvas gets attached to an observable which listens for modified posts from Firebase - When posts are deleted,
handleModificationFromGroup()
is invoked which parses the post and usessyncBoard()
to delete the post from the canvas -
syncBoard()
looks for theremoved
flag to be true and if so, it removes the post from the user's canvas