reitit icon indicating copy to clipboard operation
reitit copied to clipboard

Allow multimethods to be treated as interceptors

Open philomates opened this issue 3 years ago • 0 comments

In a service I was working on I wanted to use a multimethod as an interceptor. It errored out and after a little digging I realized that the IntoInterceptor was only extended to functions but not multimethod functions. One fix would be to wrap my multimethod function in a normal function closure, but figured extending IntoInterceptor to multimethods would help prevent others from running into the same issue.

The tests are failing and I can't understand why. For instance, if you repeat an interceptor derived from a function in the interceptor chain, executing the chain doesn't result in repeat entries. Probably some subtlety with how the tests are setup or IntoInterceptor is implemented from fn/multifns, but I couldn't get to the bottom of it. Any ideas?

philomates avatar Jan 19 '22 13:01 philomates