A useful application of TypexJS naming scheme is when we want to monkey patch a library function, using a proxy, as we should do there is a good discussion about different ways of doing it: the following example is extracted from its proxy case. :
const handler_o =
{
apply ( target_o, this_o, arg_a ) //: target_o and this_o aren't used here
{
console.log( `patched function is invoked with arguments: ${arg_a}` )
Reflect.apply( ...arguments )
}
}
const log__v = arg_ => console.log( `log__v is invoked with argument: ${arg_}` )
const log_o = new Proxy( log__v, handler_o )
//: Now proxy function can be invoked as:
log_o( 'Hello' )
log_o( ...['Hello'] )
log_o.call( null, 'Hello' )
log_o.apply( null, ['Hello'] )
//: All the above invocations will print the following two lines:
//-> patched function is invoked with arguments: Hello
//-> log__v is invoked with argument: Hello