redux-wpapi
A node-wpapi integration for a Redux based Application.
How it Works
This library exposes node-wpapi instance through the actionCreator callAPI. The resulting action is interpreted in the middleware, doing so by resolving the request and controlling the reducer through actions.
Installation
npm install --save redux-wpapi
Then, to enable ReduxWPAPI, use applyMiddleware()
and combineReducers()
:
;; const reducer: wp middleware = /* … */ ;const store = ;
Usage
;;; Component static { return props; } { HomePage; } { HomePage; } { const status data: posts = thispropsrequest; if !posts return <div> !postslength ? <NoPostFound /> : <PostList posts=posts /> </div> ; } request: callAPI HomePage;
Contributions
All contributions are welcome, and very much appreciated.
We are preparing some helper documents to facilitate the process (hopefully), but for now we're following the these guidelines:
- Be reasonable
- Give as much detailed information as you can
- Keep it as short as possible
- Let the code talk
Must have's
Every Pull Request must have the following:
- Unit tests for any functionality that's exposed to the end user.
- An entry in the CHANGELOG.md file.