Skip to content

Create a people paging psudeo-class usable for Mixpanel's platform reports

License

Notifications You must be signed in to change notification settings

jordanmnunez/mp-platform-people-pager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Platform People Pager

Create a people paging psudeo-class usable for Mixpanel's platform reports

Including the library:

<script src="https://cdn.rawgit.com/jordanmnunez/mp-platform-people-pager/master/peoplepager.js"></script>

PeoplePager( Function callable [, String selector [, Function callback]])

###Parameters

  • callable: a function to be called on for user returned from the request. The user object will be passed in as the first argument of the callable and will be a dictionary of all properties, including $distinct_id.
  • selector: a string to be included as the selector property of the people query. To query all users set as null
  • callback: a function to be called once the callable has run on every user. No arguments are passed through.

###Example

Treating the constructor as a function you can create a one-off query.

function processUser(user) {
  console.log(user["$distinct_id"]);
}

var selector = '(defined (properties["$name"]))'

function finishedProcessing() {
  console.log('done');
}

PeoplePager(processUser, selector, finishedProcessing);

About

Create a people paging psudeo-class usable for Mixpanel's platform reports

Resources

License

Stars

Watchers

Forks

Packages

No packages published