Skip to content

Commit

Permalink
Prefer as const with TypeScript 4.9 introduced satisfies operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Nov 24, 2022
1 parent 77a0693 commit cb181e1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/session/Timer.tsx
Expand Up @@ -89,14 +89,12 @@ const Timer = ({
setIterationCount(1);

if (Notification.permission !== "granted") {
const alertMessageByNotificationPermission: Readonly<
{
[key in NotificationPermission]: string;
}
> = {
const alertMessageByNotificationPermission = {
granted: "Thanks to accept the notification :)",
denied: "You rejected the notification :(Please accept it.",
default: "Can not judge to use notification :(Please accept it.",
} as const satisfies {
[key in NotificationPermission]: string;
};

void Notification.requestPermission((result) => {
Expand Down

0 comments on commit cb181e1

Please sign in to comment.