useSchedule hook provides a way to fetch, display, and update the notification schedule for the current subscriber.
Hook parameters
Return value
Schedule type
TheSchedule type from @novu/react includes these properties:
Schedule object structure.
EachDaySchedule object within weeklySchedule has the following structure:
Updating the schedule
The hook also allows updating the subscriber’s schedule viaschedule.update:
Example usage
Here’s how to use theuseSchedule hook to display and update a subscriber’s notification schedule. The schedule.update() method creates a schedule if one doesn’t exist or updates the existing one.