Replies: 5 comments
-
[DEFAULT]
Final connection count = 1 PS. Equivalent to rxjs |
Beta Was this translation helpful? Give feedback.
-
Example sequence of actions and behavior:
Final connection count = 1 PS. Equivalent to rxjs |
Beta Was this translation helpful? Give feedback.
-
Example sequence of actions and behavior:
Final connection count = 3 PS. Equivalent to rxjs |
Beta Was this translation helpful? Give feedback.
-
Example sequence of actions and behavior:
Final connection count = 3 PS. Equivalent to rxjs |
Beta Was this translation helpful? Give feedback.
-
Notes from discussion with @joaqcid around how to control concurrency....
|
Beta Was this translation helpful? Give feedback.
-
@markwhitfeld comments:
Ok, so I'll summarise my discussions with @joaqcid in separate comments below.
Firstly, let's establish a baseline for what the connect options mean:
trackBy
: used to determine how many connections are triggered by the same actiontrackBy
will allow for multiple connections, each of which is identified by the data returned by thetrackBy
that you providetrackBy
(the default) then there will only ever be one active connection for this actiontrackBy
then there will only ever be one connection for this actioncancelPrevious
: used to determine how a new action will be handledcancelPrevious
is false (the default) then new actions are ignored if there is an existing connection with the sametrackBy
cancelPrevious
is true, then the new action will be used to create a connection that will replace an existing connection with the sametrackBy
The combination of these two properties fully determines how the
NgxsFireStoreConnect
handles its "connections" to streams. Obviously the source stream created by the action call can also have its own logic about when it completes.Each combination of options is listed below:
{ trackBy: undefined, cancelPrevious: false, ... }
connect options config and scenarios #53 (comment){ trackBy: undefined, cancelPrevious: true, ... }
connect options config and scenarios #53 (comment){ trackBy: (a) => a.id, cancelPrevious: false, ... }
connect options config and scenarios #53 (comment){ trackBy: (a) => a.id, cancelPrevious: true, ... }
connect options config and scenarios #53 (comment)Beta Was this translation helpful? Give feedback.
All reactions