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

Method getValue

packages/xadmin/src/app.js:73–92  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

71 }
72
73 getValue(value) {
74 if(typeof value == 'function' && value.length == 1) {
75 if(value.constructor.name == 'GeneratorFunction') {
76 const it = value(this)
77 const go = (result) => {
78 if (result.done) return result.value
79 return result.value.then((v) => {
80 return go(it.next(v))
81 }, (error) => {
82 return go(it.throw(error))
83 })
84 }
85 return it
86 } else {
87 return value(this)
88 }
89 } else {
90 return value
91 }
92 }
93
94 reduce(key, load_reducer, init_state = {}) {
95 if(this._cache[key] == undefined) {

Callers 3

mapMethod · 0.95
arrayMethod · 0.95
mapArrayMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected