Skip to content
🐎 A redux system for your JSON API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
examples
main
website
.editorconfig
.eslintrc.js
.gitignore
.nvmrc
CHANGELOG.md
Readme.md
commitlint.config.js
cz-config.js
lerna.json
makefile
package.json
pohleusis.svg
yarn.lock

Readme.md

Table of Contents

Overview

In your average, mildly sophisticated React app, getting and updating data against an API is half the battle. If you've felt the pain of redundant code filling up all your component lifecycle methods - in order to fill your UI with data - then this library is for you.

Pohleusis is a small library that helps you with the 3 most annoying parts:

  1. Getting data from a spec-compliant JSON API
  2. Getting "nested" data off of relationships
  3. Managing i18n localization of your data

By colocating all of the above in one place, Formik will keep things organized - making testing, refactoring, and reasoning about your forms a breeze.

Developer Experience

I (@morgs32) wrote Pohleusis while building www.stackshirts.com.

When half the code for our components had to do with GET/PATCH/PUT/DELETE methods against our API, it quickly became obvious that we could benefit by standardizing not just our display of the data, but also the way in which data flowed into and out of our app.

This is a design system for your data.

Before you get started

You have to have a JSON API. Check out the spec. If you do not think your own API makes more sense as a completely compliant JSON API, raise an issue here - I want to know about it.

Not only does it build consistency into your API, it builds consistency into the way you use the data from the API. You'll never confuse which fields are relationships to other data. You'll never have to guess where to go looking for it.

In some ways, the JSON API spec is a simpler, more intuitive way to accomplish what many people use GraphQL to do - get all the data you need for a given block of UI in one request. Check out the JSON API way to include related resources.

So start building your API according to spec immediately.

Who's got a valid JSON API?

Demos & Examples

Two examples (in the examples/ directory here and on codesandbox):

Getting Started

Components

Get

Query

Localization

Dispatchers

wrapCreate

wrapUpdate

wrapDestroy

Contribution Guide

  • Just make sure to use conventional commits.

  • From root directory

    yarn watch
    
  • I recommend developing against either of the examples:

    cd examples/valid-api-spec
    yarn
    yarn dev
    

Todo List

You can’t perform that action at this time.