Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bluewings/with-hocs
https://github.com/bluewings/with-hocs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bluewings/with-hocs
- Owner: bluewings
- Created: 2018-09-14T02:46:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T05:19:47.000Z (over 6 years ago)
- Last Synced: 2024-10-18T02:23:45.042Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# with-hocs
```jsx
import withHOCs from 'with-hocs';
import { defaultProps, withPropsOnChange } from 'recompose';function Sample(props) {
returnHELLO {props.capitalized}!
;
}// pass high-order components via hocs props
const Enhance = withHOCs({ importAs: 'hocs' })(Sample);const hocs = [
defaultProps({
name: 'World',
}),withPropsOnChange(['name'], ({ name }) => ({
capitalized: name.toUpperCase(),
})),
];// HELLO SYDNEY!
```