Skip to content
This repository was archived by the owner on Dec 31, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mobxjs/mobx-react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.3.2
Choose a base ref
...
head repository: mobxjs/mobx-react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.3.3
Choose a head ref
  • 4 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 18, 2018

  1. Copy the full SHA
    e1490b1 View commit details

Commits on Oct 19, 2018

  1. Merge pull request #578 from JefHellemans/fix-conditional-disposeOnUn…

    …mount
    
    Fix conditional disposeOnUnmount, also no pesky DS_Store files
    mweststrate authored Oct 19, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2356e20 View commit details
  2. updated changelog

    mweststrate committed Oct 19, 2018
    Copy the full SHA
    8ce6c18 View commit details
  3. Published version 5.3.3

    mweststrate committed Oct 19, 2018
    Copy the full SHA
    b961d0b View commit details
Showing with 10 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +4 −0 CHANGELOG.md
  3. +1 −1 package.json
  4. +4 −0 src/disposeOnUnmount.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -19,3 +19,4 @@
/test/browser/test_bundle.js
/.source.*
yarn-error.log
.DS_Store
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# MobX-React Changelog

### 5.3.3

* Fixed `Cannot read property 'forEach' of undefined` exception if `disposeOnUnmount` was called conditionally. [#578](https://github.com/mobxjs/mobx-react/pull/578) by [Jef Hellemans](https://github.com/JefHellemans)

### 5.3.2

* Fixed: "process not defined", [#574](https://github.com/mobxjs/mobx-react/pull/574/) through [#576](https://github.com/mobxjs/mobx-react/pull/576/) by [@xaviergonz](https://github.com/xaviergonz)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-react",
"version": "5.3.2",
"version": "5.3.3",
"description": "React bindings for MobX. Create fully reactive components.",
"main": "index.js",
"jsnext:main": "index.module.js",
4 changes: 4 additions & 0 deletions src/disposeOnUnmount.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ import { patch, newSymbol } from "./utils/utils"
const storeKey = newSymbol("disposeOnUnmount")

function runDisposersOnWillUnmount() {
if (!this[storeKey]) {
// when disposeOnUnmount is only set to some instances of a component it will still patch the prototype
return;
}
this[storeKey].forEach(propKeyOrFunction => {
const prop =
typeof propKeyOrFunction === "string" ? this[propKeyOrFunction] : propKeyOrFunction