Skip to content

Commit

Permalink
Update iframe-protocol.ts and Playground.stories.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Jun 27, 2022
1 parent 931f77c commit 6fd8113
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion sandpack-client/src/iframe-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export class IFrameProtocol {
const listenerId = this.channelListenersCount;
this.channelListeners[listenerId] = listener;
this.channelListenersCount++;

return (): void => {
delete this.channelListeners[listenerId];
};
Expand Down
17 changes: 1 addition & 16 deletions sandpack-react/src/Playground.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as themes from "@codesandbox/sandpack-themes";
import { useEffect, useState } from "react";
import { useState } from "react";

import type { CodeEditorProps } from "./components/CodeEditor";
import { useSandpack } from "./hooks";
import { SANDBOX_TEMPLATES } from "./templates";

import {
Expand All @@ -18,18 +17,6 @@ export default {
title: "Intro/Playground",
};

const Listerner = () => {
const { listen } = useSandpack();

useEffect(() => {
const foo = listen(console.log);

return () => foo();
}, [listen]);

return null;
};

export const Main = (): JSX.Element => {
const [config, setConfig] = useState({
Components: { Preview: true, Editor: true, FileExplorer: true },
Expand Down Expand Up @@ -155,8 +142,6 @@ export const Main = (): JSX.Element => {
showRefreshButton={config.Options?.showRefreshButton}
/>
)}

<Listerner />
</SandpackLayout>
</SandpackProvider>
</div>
Expand Down

0 comments on commit 6fd8113

Please sign in to comment.