{"id":19226479,"url":"https://github.com/jasonraimondi/use-notify-rxjs","last_synced_at":"2026-04-18T12:03:59.406Z","repository":{"id":52286559,"uuid":"338986429","full_name":"jasonraimondi/use-notify-rxjs","owner":"jasonraimondi","description":"Dismissable toast notifications powered by rxjs. ","archived":false,"fork":false,"pushed_at":"2021-05-02T01:48:36.000Z","size":3936,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T10:25:47.667Z","etag":null,"topics":["hooks","notifications","react","rxjs","toasts","use-notifications","use-notify"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasonraimondi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-15T06:27:16.000Z","updated_at":"2021-05-02T01:48:38.000Z","dependencies_parsed_at":"2022-09-25T05:50:17.159Z","dependency_job_id":null,"html_url":"https://github.com/jasonraimondi/use-notify-rxjs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jasonraimondi/use-notify-rxjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fuse-notify-rxjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fuse-notify-rxjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fuse-notify-rxjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fuse-notify-rxjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonraimondi","download_url":"https://codeload.github.com/jasonraimondi/use-notify-rxjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonraimondi%2Fuse-notify-rxjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hooks","notifications","react","rxjs","toasts","use-notifications","use-notify"],"created_at":"2024-11-09T15:18:56.599Z","updated_at":"2026-04-18T12:03:59.389Z","avatar_url":"https://github.com/jasonraimondi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `useNotify`\n\n[![CI](https://github.com/jasonraimondi/use-notify-rxjs/workflows/CI/badge.svg)](https://github.com/jasonraimondi/use-notify-rxjs)\n\nSimple, design-free toast notifications with a single peer dependency: `rxjs`.\n\n## Installation\n\n```bash\nnpm install --save use-notify-rxjs\n```\n\n## Usage\n\n```jsx\nimport { useNotify } from 'use-notify-rxjs';\n\nfunction Demo() {\n  const notify = useNotify();\n\n  return (\n  \u003c\u003e\n    \u003cdiv\u003e\n      \u003cbutton onClick={() =\u003e notify.success({ message: \"This is a success notification\", title: \"Congrats!\", ttl: 2000 })}\u003eAdd Success\u003c/button\u003e\n      \u003cbutton onClick={() =\u003e notify.info({ message: \"This is an info notification\", ttl: 10000 })}\u003eAdd Info\u003c/button\u003e\n      \u003cbutton onClick={() =\u003e notify.error(\"This is an error notification\")}\u003eAdd Error\u003c/button\u003e\n    \u003c/div\u003e\n    \u003cul\u003e\n      {notify.notifications.map(note =\u003e\n        \u003cli key={note.id} className={note.type}\u003e\n          \u003cspan\u003e{note.message}\u003c/span\u003e \n          \u003cspan onClick={() =\u003e clear(note.id)}\u003e\u0026times;\u003c/span\u003e\n        \u003c/li\u003e\n      )}\n    \u003c/ul\u003e\n  \u003c/\u003e\n  );\n}\n```\n\n```jsx\nfunction App() {\n  return \u003cNotifyProvider supressDuplicates\u003e\n    \u003cDemo /\u003e\n  \u003c/NotifyProvider\u003e;\n}\n\nReactDOM.render(\u003cApp/\u003e, document.getElementById(\"root\"));\n```\n\n## Reference\n\n```ts\nconst { notifications, success, info, error, clear } = useNotify();\n```\n\n- **`notifications`**_`: Notify[]`_ - list of notifications\n- **`success`**_`: (message: string | NofityMessage) =\u003e void`_ - send success alert\n- **`info`**_`: (message: string | NofityMessage) =\u003e void`_ - send info alert\n- **`error`**_`: (message: string | NofityMessage) =\u003e void`_ - send error alert\n- **`clear`**_`: (id?: number) =\u003e void`_ - clear single or all alerts\n\n```ts\ntype Notify = {\n  id: number;\n  message: string;\n  title?: string;\n  type: NotifyType;\n  isSuccess: boolean;\n  isInfo: boolean;\n  isError: boolean;\n  ttl: number;\n}\n\ntype NotifyMessage = {\n  message: string;\n  title?: string;\n  ttl?: number; // override global ttl for individual message\n}\n\nenum NotifyType {\n  Error = \"error\",\n  Info = \"info\",\n  Success = \"success\",\n}\n```\n\nProvider Options:\n\n```jsx\n\u003cNotifyProvider ttl={4500} supressDuplicates={true}\u003e\n  \u003cDemo /\u003e\n\u003c/NotifyProvider\u003e\n```\n\n- **`ttl`**_`: number (optional, default: 4500)`_ - number of ms the notification should be kept alive\n- **`supressDuplicates`**_`: boolean (optional, default: false)`_ - supress duplicate notifications by tracking notify history\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonraimondi%2Fuse-notify-rxjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonraimondi%2Fuse-notify-rxjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonraimondi%2Fuse-notify-rxjs/lists"}