# 서버 없이 SharedWorker를 활용하여 윈도우 간 상태 공유

> Clean Markdown view of GeekNews topic #12584. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=12584](https://news.hada.io/topic?id=12584)
- GeekNews Markdown: [https://news.hada.io/topic/12584.md](https://news.hada.io/topic/12584.md)
- Type: news
- Author: [safethecode](https://news.hada.io/@safethecode)
- Published: 2023-12-29T10:43:10+09:00
- Updated: 2023-12-29T10:43:10+09:00
- Original source: [dev.to](https://dev.to/notachraf/sharing-a-state-between-windows-without-a-serve-23an)
- Points: 8
- Comments: 3

## Topic Body

- 소개  
  - 서버 없이 SharedWorker를 사용하여서 윈도우 간 상태 공유를 함.  
  - 브라우저 API를 통해서 윈도우 간 상태를 공유할 수 있다는 것에 의의를 가질 수 있음.  
  
- 원리  
  - 각 윈도우를 식별함  
  - 온라인 된 모든 윈도우 상태를 추적함  
  - 윈도우의 상태가 변경되면 다시 그리도록 다른 창에 알려줌.  
  
- 추가 의견  
  - 현재 글에는 포함되어 있지 않지만, Broadcast Channel API 를 사용하면 더 효율적으로 윈도우 간 상태 공유 가능(https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API)

## Comments



### Comment 31122

- Author: carnoxen
- Created: 2024-11-11T10:42:35+09:00
- Points: 1

[Inter-process communication](https://en.m.wikipedia.org/wiki/Inter-process_communication)  
  
이거와 꽤나 유사하군요

### Comment 21803

- Author: dbswnschl
- Created: 2023-12-29T12:31:47+09:00
- Points: 1

앗 windows가 아니고 window 였네요 ㅋㅋㅋ  
  
신기한 기능이군요

### Comment 21926

- Author: safethecode
- Created: 2024-01-03T11:05:42+09:00
- Points: 1
- Parent comment: 21803
- Depth: 1

ㅋㅋㅋㅋㅋㅋ 맞습니다! browser window 입니다
