foundation-notifications.notifycontainerconfig.sortfn
Home > @genesislcap/foundation-notifications > NotifyContainerConfig > sortFn
NotifyContainerConfig.sortFn property
An optional comparator function to sort visible notifications. Follows the same signature as Array.sort — return a negative number to sort a before b (i.e. higher in the stack). Re-applied automatically whenever the set of visible notifications changes. See sortNotificationBySeverity() for a ready-made example.
Signature:
sortFn?: (a: HTMLElement, b: HTMLElement) => number;