Skip to content

Instantly share code, notes, and snippets.

@isavch
Last active December 15, 2017 14:08
Show Gist options
  • Select an option

  • Save isavch/b73eaeb6c9c85df7d33e29565c8d4d43 to your computer and use it in GitHub Desktop.

Select an option

Save isavch/b73eaeb6c9c85df7d33e29565c8d4d43 to your computer and use it in GitHub Desktop.
api2
/* API usage */
import initApi from 'redux-wp';
initApi(store);
/* Somewhere in the user code */
import getPost from 'wp-redux'
getPost(2, 'posts')
.then(post => console.log(post));
/* Implementation */
import getPostFactory from './getPost';
let store = null;
export function init(store) {
store = store;
}
export const getPost = getPostFactory(store);
export const getTaxonomies = getTaxonomiesFactory(store)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment