* @param {FetchCallback} cb
(cb, state)
| 133 | * @param {FetchCallback} cb |
| 134 | */ |
| 135 | async fetch(cb, state) { |
| 136 | const url = cb.url.replace(/\{([^\}]+)\}/g, (m, v) => { |
| 137 | return PathHelper.get(state, v); |
| 138 | }); |
| 139 | const res = await (await api.fetchApi(url)).json(); |
| 140 | state["$result"] = res; |
| 141 | for (const m of cb.then) { |
| 142 | await invokeCallback(m, state); |
| 143 | } |
| 144 | }, |
| 145 | /** |
| 146 | * @param {SetCallback} cb |
| 147 | */ |
no test coverage detected