TODO
Context
What is local middleware?
defmodule Client do
use Tesla
plug :some_local_function
def some_local_function(env, next) do
# ...
end
end
Pros
- No need to create a separate module for something trivial
Cons
- Additional complexity
- Conflicting API with now-removed aliases support
- The function must be public anyway
The local middleware can be replaced with simply module:
defmodule Client do
defmodule LocalMiddleware do
def call(env, next, _opts) do
# ...
end
end
use Tesla
plug LocalMiddleware
end
Question
Is local function middleware widely used or not?
/cc @amatalai @hodak @any-other-tesla-user
TODO
Context
What is local middleware?
Pros
Cons
The local middleware can be replaced with simply module:
Question
Is local function middleware widely used or not?
/cc @amatalai @hodak @any-other-tesla-user