Skip to main content

Toasts Service

The @rhapsody/toasts package is now available and replaces the Notify Angular module. The service exposes the errorToast, infoToast, successToast, and warningToast functions to display different toast messages in the application. A generic createToast function is also available for advanced use-cases.

Example

import { successToast } from '@rhapsody/toasts'

// Title only
successToast('Success')

// Title and subtitle
successToast('Success', 'The operation completed successfully')

// Title, subtitle, and action
successToast({
title: 'Success',
subtitle: 'The operation completed successfully',
actionCallback: () => {},
actionText: 'View',
})

The toast service is written in Typescript and can be used in JavaScript and Typescript code. New code should use this service and any existing non-Angular code should be refactored to use this service as well. Existing Angular code referencing the Notify module can be left as-is since the Notify module now uses the toast service under the hood.