Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Question: How to know when loadSaveData ends the live drawing? #37

Closed
iknox27 opened this issue Oct 15, 2019 · 3 comments
Closed

Question: How to know when loadSaveData ends the live drawing? #37

iknox27 opened this issue Oct 15, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@iknox27
Copy link

iknox27 commented Oct 15, 2019

Hi @embiem I tried approach number 1 from here #3 but didn't received any log. Is there a way to know when loadSaveData ends the live drawing ?

@embiem embiem added the enhancement New feature or request label Nov 22, 2019
@embiem
Copy link
Owner

embiem commented Nov 22, 2019

Hi and thanks for your question. Currently it's not possible to know when loadSaveData ends the live drawing.

I suggest we add a callback prop like onLoadEnd, which gets called after the initial load of a saved drawing is finished.
Would this solve your issue?

@ksocha
Copy link

ksocha commented Jan 8, 2020

I have a similar issue. I'm currently trying to sync canvas data between multiple users (each of them has to be able to draw).
I've tried to make use of onChange prop to get the data from currently drawing user and propagate it to other users. After receiving the data, others would call loadSaveData to apply it to their canvases. Problem is that after calling loadSaveData, onChange callback is called too causing infinite loop of synchronising. I really could make a use of additional callback that would be called only once after the user ends interacting with the canvas.

@embiem
Copy link
Owner

embiem commented Nov 8, 2021

Seems to be related to #93, where we track this issue right now.

@embiem embiem closed this as completed Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants