Catch function transpilation
Hello.
I try to use fetch api, but cannot use catch
function. When I try something like this:
(ps:ps
(ps:chain
(fetch "/value")
(then
(lambda (resp)
(chain resp (json))))
(catch
(lambda (err)
(ps:chain console (error err))))))
I get this:
fetch('/value').then(function (resp) {
return resp.json();
})['catch'](function (err) {
return console.error(err);
});
It works, but looks strange. :) I expected this:
fetch('/value').then(function (resp) {
return resp.json();
}).catch(function (err) {
return console.error(err);
});
Is this intentional?