I'm trying to get familiar with ngrx/data but I'm not sure about its capabilities. I've read the documentation and some tutorials but there are still a lot of question marks:
ngrx/data offers methods for CRUD functionality. But what about additional non-CRUD requests? Is it possible to extend ngrx/data for non-CRUD requests (for example a login request or something) and to implement own actions, reducers and effects for this? Which part of ngrx/data must be extended? EntityAction? EntityCollectionService? EntityCollectionReducer? The documentation about these things is a little bit confusing and I don't really understand how all these parts work together. Maybe someone can give some clarification about this and provide some sample code.
In my Angular project I'm using the "traditional" store/actions/reducers/effects pattern. Sometimes an effect is triggered on multiple actions (for example, a successful update action triggers an re-read from the server). Is it possible to achieve this behavior also with ngrx/data?
Is it possible to use ngrx/data and the "traditional" store pattern together on the same store entities? ngrx/data for the CRUD operations and store/actions/reducers/effects for the non-CRUD operations?
Some hints and thoughts would be helpful. Thanks :)
for login and other not crud things you should use normal ngrx/store
interface with actions, reducers and effects.
ngrx/data
is the same set of store/actions/reducers/effects
, you can write an effect that listens on actions of ngrx/data
and performs side effects you want.
yes, see the second answer. ngrx/data
is just a set of store/actions/reducers/effects
that are wrapped by services.