pohleusis v1.16.1
Table of Contents
- Overview
- Before you get started
- Who's got a valid JSON API?
- Demos & Examples
- Getting Started
- The API
- import { Get } from 'pohleusis'
- import { Query } from 'pohleusis'
- import { Localization } from 'pohleusis'
- import { wrapCreate } from 'pohleusis'
- import { wrapUpdate } from 'pohleusis'
- import { wrapDestroy } from 'pohleusis'
- Contribution Guide
- Todo List
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:
- Getting data from a spec-compliant JSON API
- Getting "nested" data off of relationships
- 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
If you're going to develop against another app (using `yarn link`)
then make sure to link back to your own app's react/redux modules:
"devDependencies": {
...
"react": "link:../../stackshirts/app/node_modules/react",
"react-redux": "link:../../stackshirts/app/node_modules/react-redux",
"redux": "link:../../stackshirts/app/node_modules/redux"
}
Todo List
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago