You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-09-03 08:42:03 +03:00
Handle m.typing events.
This commit is contained in:
12
lib/utils.js
12
lib/utils.js
@@ -99,6 +99,18 @@ module.exports.values = function(obj) {
|
||||
return values;
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoke a function for each item in the array.
|
||||
* @param {Array} array The array.
|
||||
* @param {Function} fn The function to invoke for each element. Has the
|
||||
* function signature <code>fn(element, index)</code>.
|
||||
*/
|
||||
module.exports.forEach = function(array, fn) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
fn(array[i], i);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the given thing is a function.
|
||||
* @param {*} value The thing to check.
|
||||
|
Reference in New Issue
Block a user