Read the statement by Michael Teeuw here.
start() vs receiving waiting for MODULE_DOM_CREATED notification?
-
i was having trouble with a module reliably starting (might be my underpowered RasPi), and i thought maybe it was trying to load before the system was ready. so i moved some startup code from the start() function to a custom function that gets called after the module receives its MODULE_DOM_CREATED notification.
is this a bad idea, just useless, or might it actually do some good?
-
@dathbe you could try waiting til ALL_MODULES_STARTED or
DOM_OBJECTS_CREATED, per the doc
https://docs.magicmirror.builders/development/notifications.html#system-notificationsMODULE_DOM_CREATED is in response to getDom() returning the dom object so it might be quite late
-
@sdetweil I’d rather have late and working consistently than early and missed because of lag. I suspect most people boot their mirror at most once a day, so waiting an extra 30 seconds for the module to show content doesn’t seem like that big of a deal.
But I’ll try DOM_OBJECTS_CREATED.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login