Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 3cb0c0d

Browse files
committed
Update readme
1 parent 742636f commit 3cb0c0d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,22 @@ const { UID, login, logout, ...} = useAuthentication();
7171
Create notifications to be displayed in the app.
7272

7373
``` js
74-
const { createNotification, removeNotification } = useNotifications();
74+
const { createNotification, hideNotification } = useNotifications();
7575

7676
const handleClick = () => {
7777
createNotification({ type: 'error', text: 'Failed to update' });
7878
}
79+
80+
const handleClickPersistent = () => {
81+
const id = createNotification({
82+
expiration: -1, // does not expire
83+
type: 'error',
84+
text: 'Failed to update'
85+
});
86+
setTimeout(() => {
87+
hideNotification(id);
88+
}, 1000);
89+
}
7990
```
8091

8192
### useModals

0 commit comments

Comments
 (0)