
Buffer size 만큼 이벤트를 저장하고 있다가 구독자에게 이벤트를 방출한다.
이때 버퍼는 메모리를 차지하고 있기 때문에 필요 이상의 버퍼 사이즈를 잡고 있으면 안된다.
Behavior Subject 는 어땠었나?
시퀀스 종료 후 구독해도 버퍼에 담긴 이벤트는 전달된다.
BehaviorSubject처럼 최근의 값외에 더 많은 것을 보여주고 싶다면 어떻게 해야할까? 예를 들어 검색창같이, 최근 5개의 검색어를 보여주고 싶을 수 있다. 이럴 때 ReplaySubject를 사용할 수 있다.If you’ve added your subscriptions to a dispose bag, then everything will be disposed of and deallocated when the owner — such as a view controller or view model — is deallocated.