Read the statement by Michael Teeuw here.
Altering a Module
-
@sdetweil I am sorry, but I do not understand your response.
The original code lines @semox used in the module are:compliment.hide(0); ... compliment.show(self.config.animationSpeed, {lockString: this.name}) ... compliment.hide(self.config.animationSpeed, {lockString: this.name})
Are you saying that I should change the ()'s to {}'s in both instances?
Or are you saying that the second Parm in the 2 longer .show/.hide commands shown above, should be in {}'s? If so, they already are are they not?Rich
-
@rrslssr the functions show() and hide() take 3 parms
(speed, callback_function, options)
https://docs.magicmirror.builders/development/core-module-file.html#module-instance-methods
the ones you have only have 2 parms…
I was suggesting, if you want to get rid of the errors, that you insert a function as the second parm
and the simplest function, is the arrow function () => {}
(parms in) => {function code}so, my thing is
() (no parms) =>{} (empty function code) -
@sdetweil Thank you. Your explanation along with the link to the module-instance-methods, really help clarify things for this novice.
Take care.
Rich -
@sdetweil I’m happy to report that changing the code changes (as shown below) worked to eliminate the errors:
compliment.show(self.config.animationSpeed, ()=>{}, {lockString: this.name})
The only thing left is a warning : module tries to update the DOM without being displayed. But I don’t think I’ll worry about this error since my Frankenstein Module does not display anything.
Thanks again for your help.
Rich -
I want to do the exact same thing down the road when I need a new project to tinker with.
Love it and thank you for posting the question and thank you to Sam for working through the solution.