Skip to content

Commit

Permalink
refactor PocEvent to LightEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
floodfx committed Jan 22, 2022
1 parent de12474 commit 9c1842b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server/live/light_liveview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface LightContext {
brightness: number;
}

export type PocEvent = "on" | "off" | "up" | "down";
export type LightEvent = "on" | "off" | "up" | "down";

const _db: { [key: string]: LightContext } = {};

Expand Down Expand Up @@ -51,7 +51,7 @@ export class LightLiveViewComponent implements
`
};

handleEvent(event: PocEvent, params: any, socket: any) {
handleEvent(event: LightEvent, params: any, socket: any) {
const ctx = _db[socket.id];
console.log("event:", event, socket, ctx);
switch (event) {
Expand Down
1 change: 0 additions & 1 deletion src/server/socket/websocket_server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PocEvent, LightLiveViewComponent } from '../live/light_liveview';
import { PhxJoin, PhxEvent, PhxReply, PhxSocketProtocolNames, RenderedNode, PhxSocketProtocol, newHeartbeatReply } from './types';
import ws from 'ws';
import { router } from '../live/router';
Expand Down

0 comments on commit 9c1842b

Please sign in to comment.