First time stateLoadCallback is called
First time stateLoadCallback is called
dominivis
Posts: 2Questions: 1Answers: 0
I've got everything working fine for custom save and load state, but the first time stateLoadCallback is called I still don't have any data stored, because stateSaveCallback was not called yet.
How can I make stateSaveCallback be called first? Or what should I do on stateLoadCallback if I still have a null state?
Thanks in advance!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @dominivis ,
You can't change the ordering, that's fixed, but one option would be to call the callback with
null
on that first iteration, that would get the table loaded, something like:Hope that does the trick,
Cheers,
Colin
Thank you very much, after your tip I discovered that my problem was that I was returning an "undefined" and that doesn't work.