DEV Community

Discussion on: RxJS with React: Actions and Subjects

Collapse
 
bigab profile image
Adam L Barrett

Yeah that’s a bit of a hack but, I wanted the state to be there (1) immediately on subscribing so i needed the startsWith(1), but the scan will wait for 2 events if you don’t provide a default value, so by providing it and the startWith it works