# Subject

## 옵저버 간 단일 실행 경로를 공유하는 특별한 유형의 옵저버블

### 예시

#### 예시 1: 간단한 Subject

( [Stackblitz](https://stackblitz.com/edit/rxjs-subject-simple-example?file=index.ts\&devtoolsheight=100) )

```javascript
// RxJS v6+
import { Subject } from 'rxjs';

const sub = new Subject();

sub.next(1);
sub.subscribe(console.log);
sub.next(2); // 결과 => 2
sub.subscribe(console.log);
sub.next(3); // 결과 => 3,3 (양쪽의 subscribers로부터 로그가 찍힌다)
```

### 관련된 사용법

* [Battleship Game](/learn-rxjs-korean/learn-rxjs/recipes/battleship-game.md)
* [Lockscreen](/learn-rxjs-korean/learn-rxjs/recipes/lockscreen.md)

### 추가 자료

* [Subject](https://rxjs-dev.firebaseapp.com/api/index/class/Subject) 📰 - 공식 문서

> 📂 Source Code: <https://github.com/ReactiveX/rxjs/blob/master/src/internal/Subject.ts>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://junwoo45.gitbook.io/learn-rxjs-korean/learn-rxjs/subjects/subject.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
