1.1.2 • Published 5 years ago

voiceboxer-traverse-event-users v1.1.2

Weekly downloads
8
License
MIT
Repository
bitbucket
Last release
5 years ago

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).

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

10 years ago

1.0.0

10 years ago