Skip to main content

withNotify

The withNotify HOC allows access to the notify method in a simple way:

Parameter

keytyperequiredvalue
ComponentReact componenttrueApp
optionsobjecttruecontext, observer

Example

import { withNotify } from "hermes-io";
import { HighlightContext as context } from "@/contexts/HighlightContext";
import { HighlightObserver as observer } from "@/observers/HighlightObserver";

const App = ({ notify }) => {
const handleClick = () => notify({/*...*/});
}

export default withNotify(App, { context, observer });