Proxy Made With Reflect 4 Top »
The synthesis of these concepts leads to the (or Forwarding Proxy). This is a standard design pattern where the proxy traps simply delegate to the corresponding Reflect method.
const apiMock = new Proxy({}, get(target, endpoint) return function(params) console.log(`Mock call to $endpoint with`, params); return Reflect.apply(Promise.resolve, null, [ data: `mocked_$endpoint` ]); ; proxy made with reflect 4 top