Invariant: max notification count #

This is a simple property checking that there are never more than five notifications shown.

import { extract, always } from "@antithesishq/bombadil";
export * from "@antithesishq/bombadil/browser/defaults";

const notificationCount = extract((state) => 
    state.document.body.querySelectorAll(".notification").length,
);

export const max_notifications_shown = always(() =>
    notificationCount.current <= 5,
);