MCPcopy Create free account
hub / github.com/Packstack-Tech/packstack / withApi

Function withApi

frontend/src/app/components/higher-order/with-api.tsx:7–13  ·  view source on GitHub ↗
(mapApiToProps: (api: Api) => A)

Source from the content-addressed store, hash-verified

5import AppConsumer from 'AppContext';
6
7export 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}

Callers 8

RequestReset.tsxFile · 0.85
Login.tsxFile · 0.85
Register.tsxFile · 0.85
ResetPassword.tsxFile · 0.85
index.tsxFile · 0.85
ItemForm.tsxFile · 0.85
UploadModal.tsxFile · 0.85
index.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected