on master help sign in
Flip the arguments to Json.Decode.andThen in generated JS
commit7e6941920ff53abe0113b8061913bf0effdf061f authorEvan Czaplicki <evancz@users.noreply.github.com> dateThu 6 Oct 2016, 14:27 (10 years ago) parent849668a
1 file changed+1−1
src/Generate/JavaScript/Foreign.hs+1−1
src/Generate/JavaScript/Foreign.hs+1−1
@@ -214,6 +214,6 @@ toRecord fields =
214214 to "succeed" <== [ Opt.Record (map toFieldExpr fields) ]
215215
216216 andThen (key, tipe) decoder =
217− to "andThen" <== [ field key (decode tipe), Opt.Function [key] decoder ]
217+ to "andThen" <== [ Opt.Function [key] decoder, field key (decode tipe) ]
218218 in
219219 List.foldr andThen finalDecoder fields