voiceboxer-traverse-event-users

1.1.2 • Public • Published

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: 'moderator@example.com', id: 'modid' },
	presenters: [
		{ email: 'presenter0@example.com', id: 'preid0' },
		{ email: 'presenter1@example.com', 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).

Package Sidebar

Install

npm i voiceboxer-traverse-event-users

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

3.27 kB

Total Files

3

Last publish

Collaborators

  • kasperkronborg
  • kapetan
  • voiceboxer