I'm currently utilizing Gametime.js to create a real-time world chat feature.
All messages are kept in a database for storage.
Interestingly, PubNub, which is used by Gametime.js, seems to require messages to be sent twice for them to actually go through.
Is there a way to execute a function twice without using a loop?
I've attempted the following method:
for (let i = 0; i < 2; i++) { gametime.run("msg", [msg]) }
While this solution works, I find myself needing to do it frequently throughout my script. Is there an alternative approach that doesn't involve a for/while loop?
Here's what I aim to accomplish with an example:
// can't use a for loop here
function example(msg) { doSomething(), doSomethingElse, {{run twice}}, done() }