Skip to content

Conversation

saitonakamura
Copy link
Contributor

WIP

By adding observer to the pool when it's created rather than we have an
element to observe

Motivation and context

Fixes #152

How has this been tested?

yarn lint && yarn test and storybook manual testing

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project
  • I have read the CONTRIBUTING document
  • I have added tests to cover my changes
  • All new and existing tests passed

By adding observer to the pool when it's created rather than we have an
element to observe
@saitonakamura saitonakamura changed the title Fixed observer pool for hooks WIP Fixed observer pool for hooks Aug 4, 2020
@Rendez Rendez merged commit 807b8df into researchgate:master Aug 4, 2020
researchgate-bot pushed a commit that referenced this pull request Aug 4, 2020
## [1.3.2](v1.3.1...v1.3.2) (2020-08-04)

### Bug Fixes

* observer pool for hooks ([#153](#153)) ([807b8df](807b8df))
@researchgate-bot
Copy link

🎉 This PR is included in version 1.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

saitonakamura added a commit to saitonakamura/react-intersection-observer that referenced this pull request Nov 3, 2020
When new element already holds a ref to an observer
and the previous element (that used the same observer) unobserves,
it creates a broken state when that observer is deleted from map,
but new element holds that ref and thinks it's ok to observe

Essentially i'm bringing back part of the code deleted in researchgate#153, namely https://github.com/researchgate/react-intersection-observer/pull/153/files#diff-44cb04e2627c3ab84281b41d14880e5e822437f19144e8c14a6c95f7f7fa14bbL72

I also added tests to not to break this and researchgate#153 in the future
danez pushed a commit that referenced this pull request Nov 4, 2020
When new element already holds a ref to an observer
and the previous element (that used the same observer) unobserves,
it creates a broken state when that observer is deleted from map,
but new element holds that ref and thinks it's ok to observe

Essentially i'm bringing back part of the code deleted in #153, namely https://github.com/researchgate/react-intersection-observer/pull/153/files#diff-44cb04e2627c3ab84281b41d14880e5e822437f19144e8c14a6c95f7f7fa14bbL72

I also added tests to not to break this and #153 in the future
researchgate-bot pushed a commit that referenced this pull request Nov 4, 2020
## [1.3.5](v1.3.4...v1.3.5) (2020-11-04)

### Bug Fixes

* **observer:** fix of reobserve doesn't add observer to map ([3ce4536](3ce4536)), closes [#153](#153) [/github.com//pull/153/files#diff-44cb04e2627c3ab84281b41d14880e5e822437f19144e8c14a6c95f7f7fa14bbL72](https://github.com//github.com/researchgate/react-intersection-observer/pull/153/files/issues/diff-44cb04e2627c3ab84281b41d14880e5e822437f19144e8c14a6c95f7f7fa14bbL72) [#153](#153)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getpooled function is unexpected
3 participants