woocommerce/plugins/woocommerce-admin/client/wc-api/user/selectors.js

18 lines
386 B
JavaScript

/** @format */
/**
* Internal dependencies
*/
import { DEFAULT_REQUIREMENT } from '../constants';
const getCurrentUserData = ( getResource, requireResource ) => (
requirement = DEFAULT_REQUIREMENT
) => {
const initialState = wcSettings.currentUserData;
return requireResource( requirement, 'current-user-data' ).data || initialState;
};
export default {
getCurrentUserData,
};