1.0.1 • Published 3 years ago

@feca-hooks/use-notification v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

@feca-hooks/use-notification

React Hook to use browser notification easier.

How to Install

yarn

yarn add @feca-hooks/use-notification

npm

npm i @feca-hooks/use-notification

Usage

Code

import React from "react";
import useNotification from "@feca-hooks/use-notification";

function App() {
  const sendNotification = useNotification("Hello!");

  return <button onClick={sendNotification}>Send Hello</button>;
}

Arguments

ArgumentTypeDescriptionRequired
titlestringThe text you want to notice.yes
optionsobjectReferenceno

Return

Return valueTypeDescription
sendNotificationfunctionIf permission is granted, you can send notification using this function.
1.0.1

3 years ago

1.0.0

3 years ago