(mapApiToProps: (api: Api) => A)
| 5 | import AppConsumer from 'AppContext'; |
| 6 | |
| 7 | export default function withApi<A>(mapApiToProps: (api: Api) => A) { |
| 8 | return <T extends {}>(ToWrap: React.ComponentType<T & A>): React.ComponentType<T> => (props: T) => ( |
| 9 | <AppConsumer> |
| 10 | {app => <ToWrap {...props} {...mapApiToProps(app.api)} />} |
| 11 | </AppConsumer> |
| 12 | ); |
| 13 | } |
no outgoing calls
no test coverage detected