This repository has been archived by the owner on Dec 31, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The observer decorator created 2 Symbols for each decorated component instead of reusing the Symbols for props and state that was previously created
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ export function isStateless(component) { | |
} | ||
|
||
let symbolId = 0 | ||
export function newSymbol(name) { | ||
function createSymbol(name) { | ||
if (typeof Symbol === "function") { | ||
return Symbol(name) | ||
} | ||
|
@@ -14,6 +14,14 @@ export function newSymbol(name) { | |
return symbol | ||
} | ||
|
||
const createdSymbols = {} | ||
export function newSymbol(name) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mweststrate
via email
Member
|
||
if (!createdSymbols[name]) { | ||
createdSymbols[name] = createSymbol(name) | ||
} | ||
return createdSymbols[name] | ||
} | ||
|
||
const mobxMixins = newSymbol("patchMixins") | ||
const mobxPatchedDefinition = newSymbol("patchedDefinition") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am not sure this change got published.
To be more concrete - https://unpkg.com/mobx-react@5.4.3/index.js - it wasn't
@mweststrate - could you please republish the package?