Skip to content

Commit

Permalink
Move event names to constants file
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jul 16, 2024
1 parent 6f481f3 commit 2f1d25b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const TELEMETRY = `${ADDON_ID}/telemetry`;
export const ENABLE_FILTER = `${ADDON_ID}/enableFilter`;
export const REMOVE_ADDON = `${ADDON_ID}/removeAddon`;

export const FETCH_ABORTED = `${ADDON_ID}/ChannelFetch/aborted`;
export const FETCH_REQUEST = `${ADDON_ID}ChannelFetch/request`;
export const FETCH_RESPONSE = `${ADDON_ID}ChannelFetch/response`;

export const CONFIG_OVERRIDES = {
// Local changes should never be auto-accepted
autoAcceptChanges: false,
Expand Down
4 changes: 1 addition & 3 deletions src/utils/ChannelFetch.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Channel } from "@storybook/channels";

export const FETCH_ABORTED = "ChannelFetch/aborted";
export const FETCH_REQUEST = "ChannelFetch/request";
export const FETCH_RESPONSE = "ChannelFetch/response";
import { FETCH_ABORTED, FETCH_REQUEST, FETCH_RESPONSE } from "../constants";

type ChannelLike = Pick<Channel, "emit" | "on" | "off">;

Expand Down
4 changes: 1 addition & 3 deletions src/utils/useChannelFetch.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useChannel } from "@storybook/manager-api";

const FETCH_ABORTED = "ChannelFetch/aborted";
const FETCH_REQUEST = "ChannelFetch/request";
const FETCH_RESPONSE = "ChannelFetch/response";
import { FETCH_ABORTED, FETCH_REQUEST, FETCH_RESPONSE } from "../constants";

type SerializedResponse = {
status: number;
Expand Down

0 comments on commit 2f1d25b

Please sign in to comment.