Documentation of `refCount` is wrong
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
Documentation Related To Component:
Please check those that apply
- typo
- documentation doesn't exist
- documentation needs clarification
- error(s) in example
- needs example
Description Of The Issue
Documentation in refCount says:
Note that using the share operator is exactly the same as using the publish operator (making the observable hot) and the refCount operator in a sequence.
But I think it`s not "exactly same".
If I subscribe an observable that already completed, observable with publish & refCount won`t restart.
But the completed observable with share will restart.
I`m not sure which is wrong: doc or real code.
======EDIT======
I think I found an alias for publish and share
publish()
/* is equivalent to */
multicast(new Subject()) // Subject Object
share()
/* is equivalent to */
multicast(() => new Subject()), // Subject Factory
refCount()
Maybe it could be some hint?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked refCount documentation and reproduce the behavior in the linked StackBlitz index.ts example. Compare the documented relationship between share, publish, and refCount with the observed behavior after completion; the work is done when the documentation accurately describes the distinction or the example is corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100