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,14 @@
|
|||
-spec decoder(Handler::module(), State::any(), Opts::jsx:opts()) -> jsx:decoder().
|
||||
|
||||
decoder(Handler, State, Opts) ->
|
||||
fun(JSON) -> value(JSON, {Handler, State}, [], jsx_utils:parse_opts(Opts)) end.
|
||||
fun(JSON) ->
|
||||
value(
|
||||
JSON,
|
||||
{Handler, Handler:init(State)},
|
||||
[],
|
||||
jsx_utils:parse_opts(Opts)
|
||||
)
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue