Theory

Sometimes you need to select some part of current tree. You need selectors.

Selectors are a way to store a some kind of pointer to a range of links in links.

For example, selectors are used in the system of rules and permissions.

For complete understanding, you need to understand Trees.

Selector Include Exclude SelectorTree - is link types from preinstalled @deep-foundation/core deep links package.

Preparation

A few steps further duplicate the steps from Trees. If you did, you can use the links from there.

<TreesPreparationDuplication>

Let's prepare the types for a reproducible example.

Screenshot 2022-02-25 at 15.31.42.png

<aside> ‼️ Attention! IDs may not match, as they are taken from different examples. Be careful with mutations.

</aside>

</TreesPreparationDuplication>

Create demo structure of selector.

Screenshot 2022-02-26 at 21.00.12.png

We need to insert an instance of Selector, SelectorInclude and SelectorExclude. SelectorFilter will be discussed later (here).