Skip to content

Commit 3060340

Browse files
committed
feat: 브릿지 커맨드 데이터 선택적 속성으로 변경
- BridgeCommand 인터페이스의 data 속성을 선택적으로 변경하여 유연성 향상 - sendCommand 메서드의 data 매개변수도 선택적으로 수정
1 parent 797ddf5 commit 3060340

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/web/src/types/bridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type CommandDataMap = {
1515

1616
export interface BridgeCommand<T extends CommandType> {
1717
type: T;
18-
data: CommandDataMap[T];
18+
data?: CommandDataMap[T];
1919
}
2020

2121
declare global {

apps/web/src/utils/bridge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NativeBridge {
6565

6666
private sendCommand<T extends CommandType>(
6767
type: T,
68-
data: CommandDataMap[T],
68+
data?: CommandDataMap[T],
6969
): void {
7070
try {
7171
const bridgeCommand: BridgeCommand<T> = {
@@ -88,7 +88,7 @@ class NativeBridge {
8888
}
8989

9090
// 밈 공유하기
91-
shareMeme(data: ShareMemeData): void {
91+
shareMeme(data: ShareMemeData) {
9292
this.sendCommand(COMMAND_TYPE.SHARE_MEME, data);
9393
}
9494
}

0 commit comments

Comments
 (0)