This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Impelement createEagerFactory and rename createElement to createEagerElement * Add docs and expose in main export
- Loading branch information
Showing
22 changed files
with
155 additions
and
115 deletions.
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import createEagerElementUtil from './utils/createEagerElementUtil' | ||
import isReferentiallyTransparentFunctionComponent | ||
from './isReferentiallyTransparentFunctionComponent' | ||
|
||
const createEagerElement = (type, props, children) => { | ||
const isReferentiallyTransparent = | ||
isReferentiallyTransparentFunctionComponent(type) | ||
/* eslint-disable */ | ||
const hasKey = props && props.hasOwnProperty('key') | ||
/* eslint-enable */ | ||
return createEagerElementUtil( | ||
hasKey, | ||
isReferentiallyTransparent, | ||
type, | ||
props, | ||
children | ||
) | ||
} | ||
|
||
export default createEagerElement |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import createEagerElementUtil from './utils/createEagerElementUtil' | ||
import isReferentiallyTransparentFunctionComponent | ||
from './isReferentiallyTransparentFunctionComponent' | ||
|
||
const createFactory = type => { | ||
const isReferentiallyTransparent = | ||
isReferentiallyTransparentFunctionComponent(type) | ||
return (p, c) => | ||
createEagerElementUtil(false, isReferentiallyTransparent, type, p, c) | ||
} | ||
|
||
export default createFactory |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import createHelper from './createHelper' | ||
import { internalCreateElement } from './createElement' | ||
import createEagerFactory from './createEagerFactory' | ||
|
||
const mapProps = propsMapper => BaseComponent => { | ||
const createElement = internalCreateElement(BaseComponent) | ||
return props => createElement(propsMapper(props)) | ||
const factory = createEagerFactory(BaseComponent) | ||
return props => factory(propsMapper(props)) | ||
} | ||
|
||
export default createHelper(mapProps, 'mapProps') |
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
Oops, something went wrong.