Package: duncanmalashock/json-rest-api

I’m happy to share my first published Elm package, JsonRestApi.

The goal of JsonRestApi is to make Elm application development faster by providing helpers for making requests and handling responses from a JSON REST API for common CRUD operations.

Check it out at:
http://package.elm-lang.org/packages/duncanmalashock/json-rest-api/latest

I had the following design goals:

  • Expose a small, easy-to-understand interface.
  • Use the WebData pattern described by Kris Jenkins.
  • Allow for commonly needed configurations, such as:
    • Specifying request headers
    • HTTP verbs used
    • Allowing responses to return no content
  • Provide help with handling responses and updating data in the Model in addition to making the requests.

Please use it in your projects, and feel free to get in touch with me on GitHub or the Elm Slack with any feedback on what could be improved.

Thanks to @ilias, and the Elm NYC meetup, for their helpful feedback.

Finally, JsonRestApi is a spiritual successor to the resource-api code Corey Haines wrote to make our jobs easier at Hearken, where we use Elm in production— special thanks to him for the inspiration.

4 Likes