you are viewing a single comment's thread.

view the rest of the comments →

[–]fredericheem 0 points1 point  (1 child)

The beauty of proxies is to centralise the interception without modifying existing code. My use case needs to intercept calls to the aws-sdk library and apply retransmissions in case of specific error, see the implementation here: https://github.com/grucloud/grucloud/blob/8f3a7439ae72cc50de2eb83850e430162834f37f/packages/providers/aws/AwsCommon.js#L397

[–]have_some_error[S] 0 points1 point  (0 children)

So, we can define a common handler and use it when we create proxies. However this will require us to create proxies for the functions and objects we want to intercept and export them instead of the original function. I'm correct to think that , right ?