# State actions - limiting actions state scope

**URL:** <https://discourse.aurelia.io/t/state-actions-limiting-actions-state-scope/3390>\
**Category:** Help Requests\
**Created:** [April 12, 2020, 4:23pm UTC](https://discourse.aurelia.io/t/state-actions-limiting-actions-state-scope/3390 "2020-04-12T16:23:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kremnari](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/kremnari/32/2177_2.png) [@Kremnari](https://discourse.aurelia.io/u/Kremnari)\
**Post date:** [April 12, 2020, 4:23pm UTC](https://discourse.aurelia.io/t/state-actions-limiting-actions-state-scope/3390/1 "2020-04-12T16:23:41Z")

</div>

I’m working on re-building a game using Aurelia’s State plugin. I feel I have come across an oddity. When subscribing to State, you can use `Pluck` to reach into the state and read something directly, but it seems that actions always get the global state.

If I wanted to add a student to a school, and my state is organized like  
`[District].[ZipCode].[School].[Grade].[student]`  
my addStudent action would need to transverse the entire path, even if the component I’m working in is already limited to the school. From [https://aurelia.io/#two-way-binding-and-state-management](https://aurelia.io/#two-way-binding-and-state-management) a `model` is used to contain the new person, and is updated using `return Object.assign({}, state, model)`, but this is only useful if the new person is at the base of the State.

Is there (should there?) be a way for an action to only receive and affect a specific portion of the state? Perhaps a  
`store.registerActionAtPath(stringId, functionCB, pluckPath)`

---

<div class="post-metadata">

**Author:** ![khuongduybui](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/khuongduybui/32/44_2.png) [@khuongduybui](https://discourse.aurelia.io/u/khuongduybui)\
**Post date:** [April 12, 2020, 5:14pm UTC](https://discourse.aurelia.io/t/state-actions-limiting-actions-state-scope/3390/2 "2020-04-12T17:14:07Z")

</div>

This is interesting.

It may come useful where you want to assign a part of your state to a specific component, whose (local) state is that part of your global state, and whose actions only return the local state, which is then be “reduxCombined” (for lack of better verb) back into the grand state.

However, I personally think that level of granularity is nice-to-have but not necessary.
