import { normalize, schema } from 'normalizr';
import store from './store';
const user = new schema.Entity('users');
const comment = new schema.Entity('comments', {
const article = new schema.Entity('articles', {
title: 'My awesome blog post',
const normalizedData = normalize(originalData, [article]);
type: actionTypes.READ_RESOURCES_SUCCEEDED,
// We recommend that you use the same string for the `resourceType`, resource slice,
resourceType: article.key,
resources: normalizedData.result,
includedResources: normalizedData.entities