voiceboxer-traverse-event-users
v1.1.2
Published
Traverse all users in a VoiceBoxer event object
Downloads
5
Readme
voiceboxer-traverse-event-users
Traverse all users in a VoiceBoxer event object.
npm install voiceboxer-traverse-event-users
Usage
Pass an event or a live event instance to the forEach
, map
or find
function.
var traverse = require('voiceboxer-traverse-event-users');
var event = {
moderator: { email: '[email protected]', id: 'modid' },
presenters: [
{ email: '[email protected]', id: 'preid0' },
{ email: '[email protected]', id: 'preid1' }
]
};
traverse(event, function(user, path, role) {
console.log(user, path, role);
});
The above would yield three users to the callback function, which gets the user instance, path to the object (e.g. ['presenters', 0]
) and the user role (moderator
, presenter
, interpreter
or audience
).