LearnNewsExamplesServices
Frontmatter
id6929
titleFeature Request: Add reactive `count_` config to `Neo.collection.Base`
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 1, 2025, 8:08 PM
updatedAtOct 23, 2025, 12:56 AM
githubUrlhttps://github.com/neomjs/neo/issues/6929
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 1, 2025, 8:56 PM

Feature Request: Add reactive count_ config to Neo.collection.Base

Closed v10.0.0-beta.4 enhancement
tobiu
tobiu commented on Jul 1, 2025, 8:08 PM

Is your feature request related to a problem? Please describe. The current getCount() method on Neo.collection.Base is not reactive. This means that components or other parts of the application cannot directly observe changes in the collection's size using Neo.mjs's reactive binding system. This limits the ability to easily update UI elements that depend on the number of items in a collection without manual event handling.

Describe the solution you'd like Add a reactive count_ config to Neo.collection.Base. This config should automatically update whenever items are added to or removed from the collection (e.g., via add, remove, splice methods). The afterSetCount hook should be triggered when the count changes.

Describe alternatives you've considered Currently, developers need to listen to the mutate event on the collection and manually update any dependent properties or UI elements. This adds boilerplate and complexity.

Additional context This enhancement would align Neo.collection.Base more closely with the reactive nature of other Neo.mjs components and improve integration with Neo.state.Provider for future enhancements (though direct binding via stores.myStoreName.count would still require a separate Neo.state.Provider enhancement).

tobiu assigned to @tobiu on Jul 1, 2025, 8:08 PM
tobiu added the enhancement label on Jul 1, 2025, 8:08 PM
tobiu referenced in commit 463b16c - "Feature Request: Add reactive count_ config to Neo.collection.Base #6929" on Jul 1, 2025, 8:35 PM
tobiu closed this issue on Jul 1, 2025, 8:56 PM