In addition, the message can now be closed via the ‘x’ icon.
The following shows various examples of how the function can be used and which parameters can be passed.
Message only:
To display a single message:
Code: Select all
nuMessage('hello');
Code: Select all
nuMessage(['message']);
Code: Select all
nuMessage(['message line 1', 'message line 2']);
To display a message with a duration of 2000 milliseconds:
Code: Select all
nuMessage('hello', 2000);
To display a title with a message:
Code: Select all
nuMessage('Information', 'Message here...');
Code: Select all
nuMessage('Information', ['message line 1', 'message line 2']);
Code: Select all
nuMessage('Information', ['message line 1', 'message line 2'], 2000);
Define a callback function to execute when the message is closed:
Code: Select all
const msgClosedCallback = function() {
console.log("Timeout reached. Message has been closed.");
};
Code: Select all
nuMessage('Information', ['message line 1', 'message line 2'], 2000, msgClosedCallback);