Skip to content

Commit

Permalink
🚧 feat: add socket communication sample
Browse files Browse the repository at this point in the history
  • Loading branch information
david-vaclavek committed Oct 3, 2023
1 parent b678dcc commit d4e4b3d
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 20 deletions.
7 changes: 7 additions & 0 deletions admin/src/pages/Upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Button } from "@strapi/design-system/Button";
import UploadIcon from "@strapi/icons/Upload";
import { Box } from "@strapi/design-system/Box";
import { Alert } from "@strapi/design-system/Alert";
import SockerIoClient from "socket.io-client";
import Loader from "../../modules/@common/components/PluginPageLoader";
import LocalazyUploadService from "../../modules/localazy-upload/services/localazy-upload-service";
import areLocalesCompatible from "../../modules/@common/utils/are-locales-compatible";
Expand All @@ -27,6 +28,12 @@ import PluginSettingsService from "../../modules/plugin-settings/services/plugin

import "../../i18n";

const socket = SockerIoClient.connect("http://localhost:1337");
socket.emit("subscribe", "myroom");
socket.on("create", () => {
console.log('create');
});

function Upload(props) {
const { t } = useTranslation();

Expand Down
Loading

0 comments on commit d4e4b3d

Please sign in to comment.