All Projects โ†’ Patreon โ†’ Nion

Patreon / Nion

Licence: mit
๐ŸŒต Declarative API Data Management Library built on top of redux ๐ŸŒต

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nion

React Fetches
๐Ÿ™React Fetches a new way to make requests into your REST API's.
Stars: โœญ 253 (+118.1%)
Mutual labels:  api, fetch
Nuxt Dev To Clone
Build DEV.TO clone with Nuxt.js and new `fetch` hook
Stars: โœญ 118 (+1.72%)
Mutual labels:  api, fetch
Mande
600 bytes convenient and modern wrapper around fetch
Stars: โœญ 154 (+32.76%)
Mutual labels:  api, fetch
React Refetch
A simple, declarative, and composable way to fetch data for React components
Stars: โœญ 3,418 (+2846.55%)
Mutual labels:  api, fetch
React Data Fetching
๐ŸŽฃ Declarative data fetching for React.
Stars: โœญ 496 (+327.59%)
Mutual labels:  api, fetch
Redux Api Call
One declarative API to create reducers, action creators and selectors for any API calls
Stars: โœญ 63 (-45.69%)
Mutual labels:  api, fetch
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: โœญ 787 (+578.45%)
Mutual labels:  api, fetch
Apipeline
Feature-rich and pluggable offline-first API wrapper for all your javascript environements ! Easily wire-up your API and make your app work offline in minutes.
Stars: โœญ 92 (-20.69%)
Mutual labels:  api, fetch
Kerasobjectdetector
Keras Object Detection API with YOLK project ๐Ÿณ
Stars: โœญ 113 (-2.59%)
Mutual labels:  api
Github Repo Automation
A set of tools to automate multiple GitHub repository management.
Stars: โœญ 115 (-0.86%)
Mutual labels:  api
Python and the web
Build Bots, Scrape a website or use an API to solve a problem.
Stars: โœญ 114 (-1.72%)
Mutual labels:  api
Pixiv Api Client
Promise based Pixiv API client for node.js and react native
Stars: โœญ 114 (-1.72%)
Mutual labels:  api
Ipfs Mini
A super tiny module for querying IPFS that works in the browser and node.
Stars: โœญ 115 (-0.86%)
Mutual labels:  api
Douyin Api
ๆŠ–้ŸณAPIใ€ๆŠ–้Ÿณๆ•ฐๆฎใ€ๆŠ–้Ÿณ็›ดๆ’ญๆ•ฐๆฎใ€ๆŠ–้Ÿณ็›ดๆ’ญApiใ€ๆŠ–้Ÿณ่ง†้ข‘Apiใ€ๆŠ–้Ÿณ็ˆฌ่™ซใ€ๆŠ–้ŸณๅŽปๆฐดๅฐใ€ๆŠ–้Ÿณ่ง†้ข‘ไธ‹่ฝฝใ€ๆŠ–้Ÿณ่ง†้ข‘่งฃๆžใ€ๆŠ–้Ÿณ็›ดๆ’ญ็›‘ๆŽงใ€ๆŠ–้Ÿณๆ•ฐๆฎ้‡‡้›†
Stars: โœญ 112 (-3.45%)
Mutual labels:  api
Gandi Live Dns
DynDNS Updater for Gandi LiveDNS REST API
Stars: โœญ 116 (+0%)
Mutual labels:  api
Rgbif
Interface to the Global Biodiversity Information Facility API
Stars: โœญ 113 (-2.59%)
Mutual labels:  api
Openpgp Api
OpenPGP API library
Stars: โœญ 113 (-2.59%)
Mutual labels:  api
Slouch
A JS client for CouchDB that does the heavy lifting
Stars: โœญ 116 (+0%)
Mutual labels:  api
Active hash relation
ActiveHash Relation: Simple gem that allows you to run multiple ActiveRecord::Relation using hash. Perfect for APIs.
Stars: โœญ 115 (-0.86%)
Mutual labels:  api
Awesome Jamstack
๐Ÿ“” Curated list of resources: books, videos, articles, speaker decks, tools about using the JAMstack (A modern web development architecture for creating fast, secure and dynamic websites)
Stars: โœญ 115 (-0.86%)
Mutual labels:  api

nion

nion is a library that makes it easy to fetch, update, and manage API data in a Redux store as well as bind it to React components. Nion strives to make working with data as flexible, consistent, and predictable as possible. ๐Ÿ’–

nion is heavily inspired by Apollo and GraphQL.

In a Nutshell ๐ŸŒฐ

nion is used as a hook which is given a declaration of what data is needed by the component that calls it.

import { useNion } from '@nion/nion'

export const UserContainer = () => {
    const [currentUser, actions, request] = useNion({
        dataKey: 'currentUser',
        endpoint: 'https://patreon.com/api/current_user',
    })

    const loadButton = <Button onClick={() => actions.get()}>Load</Button>

    return (
        <Card>
            {request.isLoading ? <LoadingSpinner /> : loadButton}
            {currentUser && <UserCard user={currentUser} />}
        </Card>
    )
}

We simply pass in a declaration object that tells nion what to fetch, and nion automatically handles fetching the data and returning it along with the corresponding request status.

nion can also be used as a decorator function which declares what data will be managed by the decorated component and passes in props for managing that data. This is a deprecated usage; we don't recommend writing new code that uses the decorator form.

See also:

Up and Running ๐Ÿƒ๐Ÿพโ€โ™€๏ธ

Installation

nion requires redux-thunk in order to handle its async actions, so you should install that along with the nion package.

npm install nion redux-thunk --save

Also, nion is best used as a decorator function, so you might also want to make sure you've got babel configured to handle decorator transpilation:

npm install babel-plugin-transform-decorators-legacy --save-dev

Configuration

Finally, nion has to be wired up to the redux store and optionally configured. Here's a very simple setup:

import { applyMiddleware, createStore, combineReducers } from 'redux'
import thunkMiddleware from 'redux-thunk'

import { configureNion } from 'nion'

export default function configureStore() {
    const configurationOptions = {}
    const { reducer: nionReducer } = configureNion(configurationOptions)

    const reducers = combineReducers({
        nion: nionReducer,
    })

    let store = createStore(reducers, applyMiddleware(thunkMiddleware))

    return store
}

Read more about configuring nion in the docs.

Read More ๐Ÿ“š

Licensing ๐Ÿด

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].