lift init methods into decoder/encoder
This commit is contained in:
parent
90520b9c0c
commit
d654a0e882
5 changed files with 20 additions and 7 deletions
|
@ -29,7 +29,13 @@
|
|||
-spec encoder(Handler::module(), State::any(), Opts::jsx:opts()) -> jsx:encoder().
|
||||
|
||||
encoder(Handler, State, Opts) ->
|
||||
fun(JSON) -> start(JSON, {Handler, State}, jsx_utils:parse_opts(Opts)) end.
|
||||
fun(JSON) ->
|
||||
start(
|
||||
JSON,
|
||||
{Handler, Handler:init(State)},
|
||||
jsx_utils:parse_opts(Opts)
|
||||
)
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue