Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

What exactly is a slice? #463

Open
ocxler opened this issue Sep 14, 2017 · 1 comment
Open

What exactly is a slice? #463

ocxler opened this issue Sep 14, 2017 · 1 comment

Comments

@ocxler
Copy link

ocxler commented Sep 14, 2017

Hey,
I am new to angular and especially ngrx, but I have built a working example with different components using ngrx/store (counter and chat). I understood so far, the application state is cut into different pieces of states, I have a state defined for the counter and a state for the chat, both together is the application state. In my components, I select the corresponding properties and everything works fine. My Question is: What exactly is a slice? Is it a selected part of properties of a state or is it an emitted update of a selected state? Hope somebody can explain it...
Greetings
Lukas Scheerer

@laurelnaiad
Copy link

In the one context the word is used in the docs, it's describing select, which is just distinctUntilChanged over a property (or function) over the observable object to which it is applied. In other words, if applied at root, it sees every single version of the state that comes into existence, and emits when its subject property (or function) yields a different value than it did the last time.

https://github.com/ngrx/core/blob/master/src/operator/select.ts

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

No branches or pull requests

2 participants