Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Barthmaier pbrocks

View GitHub Profile
@phpbits
phpbits / api.js
Created Oct 3, 2018
Use withSelect instead of withAPIData
View api.js
const { apiFetch } = wp;
const { registerStore, withSelect } = wp.data;
const actions = {
setUserRoles( userRoles ) {
return {
type: 'SET_USER_ROLES',
userRoles,
};
},