我正在使用normalizr获取帖子列表。
const pathSchema = new schema.Entity('paths');
export const pathListSchema= new schema.Array(pathSchema);
现在的问题是我原来的服务器响应看起来像这样。
{
data: [
{id: 1, name: "One"},
{id: 2, name: "Two"}
],
meta: {
total: 50
}
}
我想知道如何在实体旁边包括元数据(用于分页),以便结果看起来像这样。
{
entities: [
1: {id: 1, name: "One"},
2: {id: 2, name: "Two"},
],
meta: {
total: 50
}
}