Skip to content

Commit

Permalink
doc(snackbar): write a example for snackbarSignal Method
Browse files Browse the repository at this point in the history
  • Loading branch information
arashagp committed Dec 16, 2024
1 parent 8f8b745 commit 09877f4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/snackbar/src/lib/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ export const snackbarActionButtonClickedSignal = new AlwatrTrigger({

/**
* Signal for displaying the snackbar.
*
* @example
* import {snackbarSignal} from '@nexim/snackbar';
*
* snackbarSignal.notify({
* content: 'This is a snackbar message',
* // The following properties are optional.
* action: {
* label: 'Undo',
* handler: () => {
* console.log('Action button clicked');
* },
* },
* duration: '4s',
* addCloseButton: true,
* });
*/
export const snackbarSignal = new AlwatrSignal<SnackbarOptions>({name: 'snackbar'});

Expand Down

0 comments on commit 09877f4

Please sign in to comment.