Skip to main content
The Nmbr Component currently broadcasts a limited number of lifecycle/domain events related to payroll and user navigation. Your application can listen for and react to these events in order to add your own UX experiences within your app.

Events

NameDescriptionData
payroll-reviewBroadcasted when the user reaches the “review” step of the payroll run experience.{ data: { id: string}}, where id corresponds to the ID of the payroll currently being reviewed by the user

API

To listen and react to events, you need to use the on and off API available on window.nmbr. The first argument to on/off must be the name of the event you want to listen for, and the second argument must be a function that will execute when the event is broadcasted.
function alertUser(event, data) {
  window.alert(
    `CALLBACK 1: payroll-review event fired with id: ${data.data.id}`,
  );
}

// To subscribe to events via `nmbr.on`:
window.nmbr.on('payroll-review', alertUser);

// To unsubscribe from events via `nmbr.off`:
window.nmbr.off('payroll-review', alertUser);