Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please explain difference between emitLastResult and emitsLastValueToNewSubscriptions #39

Closed
fedotxxl opened this issue May 1, 2020 · 5 comments

Comments

@fedotxxl
Copy link

fedotxxl commented May 1, 2020

Can you explain the difference and add it to the description?

@TomMannson
Copy link

When You run same command second time and _emitLastResult is set to true last result of commend will be emited to the result stream immediatly after start

On the other hand emitsLastValueToNewSubscriptions decides which type of Subject will be used for result stream
true BehaviorSubject - Subject with memory of last result
In practice if You have finished execution of command and after that You will subscribe new listener last result will be provided to that listener

@escamoteur
Copy link
Collaborator

Excatly on point @TomMannson

@fedotxxl
Copy link
Author

fedotxxl commented May 13, 2020

Sorry... Still don't get the difference. Can you provide a very simple example to display the difference between these properties?

When You run same command second time and _emitLastResult is set to true last result of commend will be emited to the result stream immediatly after start

This is not clear... Isn't it the same as second one (emitsLastValueToNewSubscriptions / BehaviorSubject)

In practice if You have finished execution of command and after that You will subscribe new listener last result will be provided to that listener

Ok, got it

@escamoteur
Copy link
Collaborator

So emitLastResult effects when you call the command multiple times and emitsLastValueToNewSubscriptions effects what happens when a new subsriber is added to the command if it already has run before.

@fedotxxl
Copy link
Author

ok, got it. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants