MCPcopy Create free account
hub / github.com/sshwsfc/xadmin / computeMethodProps

Function computeMethodProps

packages/xadmin/src/wrap.js:104–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 }
103
104 computeMethodProps() {
105 const bindMethod = this.runBindMethod.bind(this)
106 return getMappers().reduce((prev, mapper) => {
107 if(mapper.method === undefined) {
108 return prev
109 }
110 const methods = mapper.method
111 let bindMethods = {}
112 for(let key in methods) {
113 const method = methods[key]
114 bindMethods[key] = (...args) => bindMethod(method)(...args)
115 }
116 return { ...prev, ...bindMethods }
117 }, {})
118 }
119
120 render() {
121 const { forwardedRef, dataProps, computeProps } = this.state

Callers

nothing calls this directly

Calls 2

getMappersFunction · 0.85
reduceMethod · 0.80

Tested by

no test coverage detected