Closed tommueller closed 6 years ago
When I delete something from my store using the RemoveData-action the item gets deleted from the store, but the reference from the parent does not get removed.
Examples
{ "id": "page1", "sections": [{ "id": "section1" }] } normalizr turns this into:
{ "id": "page1", "sections": [{ "id": "section1" }] }
{ normalized: { result: [ 'page1' ], entities: { sections: { sektion1: { id: 'sektion1' } }, pages: { seite1: { id: 'seite1', sections: ['sektion1'] } } } }
Now I run this.store.dispatch(new RemoveData({ id: section.id, schema: sectionSchema })); which leads to the following state: { normalized: { result: [ 'page1' ], entities: { sections: { }, pages: { seite1: { id: 'seite1', sections: ['sektion1'] } } } }
this.store.dispatch(new RemoveData({ id: section.id, schema: sectionSchema }));
{ normalized: { result: [ 'page1' ], entities: { sections: { }, pages: { seite1: { id: 'seite1', sections: ['sektion1'] } } } }
Which obviously breaks the code then ... any ideas why this is happening?
Please see #20 RemoveChildData support is comming in v2.2.0
RemoveChildData
@michaelkrone working fine for me as well! Thanks for the fast fixes!
When I delete something from my store using the RemoveData-action the item gets deleted from the store, but the reference from the parent does not get removed.
Examples
{ "id": "page1", "sections": [{ "id": "section1" }] }
normalizr turns this into:{ normalized: { result: [ 'page1' ], entities: { sections: { sektion1: { id: 'sektion1' } }, pages: { seite1: { id: 'seite1', sections: ['sektion1'] } } } }
Now I run
this.store.dispatch(new RemoveData({ id: section.id, schema: sectionSchema }));
which leads to the following state:{ normalized: { result: [ 'page1' ], entities: { sections: { }, pages: { seite1: { id: 'seite1', sections: ['sektion1'] } } } }
Which obviously breaks the code then ... any ideas why this is happening?