We haven't used an `apply` trap for the `selfish` examples, which illustrates that not everything is one-size-fits-all. Using an `apply` trap for this use case would involve the current `selfish` proxy returning proxies for `value` functions, and then returning a bound function in the `apply` trap for the `value` proxy. While this may sound more correct, in the sense that we're not using `.bind` but instead relying on `Reflect.apply`, we'd still need the `WeakMap` cache and `selfish` proxy. That is to say we'd be adding an extra layer of abstraction, a second proxy, and getting little value in terms of separation of concerns or maintainability, since both proxy layers would remain coupled to some degree, it'd be best to keep everything in a single layer. While abstractions are a great thing, too many abstractions can become more insurmountable than the problem they attempt to fix.
0 commit comments