Represents a notification that will be handled by a resource's notifiers
Set the for key to a notifier or a list of notifiers to route the notification
to them. This allows you to produce notifications inside of a change module
and target specific notifiers with them.
metadata is freeform data to be set however you want. resource, action, data,
changeset and actor are all set by default based on the details of the action, so
they can be omitted.
When creating a notification, a resource is required to ensure that the notification isn't
sent until the current transaction for that resource is closed. If you don't need this
behavior you can explicitly supply nil for the resource. If you supply nil for the resource,
however, you must manually set the for option, e.g: for: Notifier or for: [Notifier1, Notifier2]
Summary
Types
Any of the shapes a notification-producing hook may return: a single
notification, a list of them, a map with a :notifications key, or nil.
Functions
Normalizes any accepted notification return shape into a flat list.
Types
Any of the shapes a notification-producing hook may return: a single
notification, a list of them, a map with a :notifications key, or nil.