ngxs-labs / entity-state

⏱ WIP: Entity adapter
48 stars 12 forks source link

Adding Api Response to Entities #291

Closed shantanugupta135 closed 3 years ago

shantanugupta135 commented 3 years ago

I am getting an array from Get Api call but I am unable to add them in the entities attribute, How can I add in that attribute please let me know?

JanMalch commented 3 years ago

Both the Add and the CreateOrReplace action accept a single entity or an array of entities.

shantanugupta135 commented 3 years ago

Could you please send me the demo or any sample code to refer that?

JanMalch commented 3 years ago

The integration test shows it here: app.component.ts#L162-L175.

The library doesn't provide or recommend any particular way on how to combine the app state with your API.