LearnNewsExamplesServices
Frontmatter
id7007
titlestate.createHierarchicalDataProxy: Allow direct binding to store properties
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 10, 2025, 10:18 PM
updatedAtOct 23, 2025, 12:57 AM
githubUrlhttps://github.com/neomjs/neo/issues/7007
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 10, 2025, 10:19 PM

state.createHierarchicalDataProxy: Allow direct binding to store properties

Closed v10.0.0-beta.6 enhancement
tobiu
tobiu commented on Jul 10, 2025, 10:18 PM

Description

The Neo.state.createHierarchicalDataProxy has been enhanced to directly expose Neo.data.Store instances via the data.stores path. This allows developers to bind directly to properties of stores (e.g., data.stores.myStore.count) within bind configurations and formulas without needing intermediate data properties or listeners.

Changes Made

  • Modified src/state/createHierarchicalDataProxy.mjs to include special handling for the stores property in the get trap.
  • When data.stores is accessed, a new proxy is returned that delegates to Neo.state.Provider.getStore() for hierarchical resolution of store instances.
  • This enables Neo.core.Effect to directly track changes to reactive configs (like count) on the returned Neo.data.Store instances.

Verification

Verified that the example in learn/guides/datahandling/StateProviders.md now correctly binds directly to data.stores.mySharedStore.count and updates reactively when the store's count changes.

tobiu assigned to @tobiu on Jul 10, 2025, 10:18 PM
tobiu added the enhancement label on Jul 10, 2025, 10:18 PM
tobiu referenced in commit 9ea7745 - "state.createHierarchicalDataProxy: Allow direct binding to store properties #7007" on Jul 10, 2025, 10:19 PM
tobiu closed this issue on Jul 10, 2025, 10:19 PM