LearnNewsExamplesServices
Frontmatter
id5855
titlecollection.Base: add protected for the map
stateClosed
labels
enhancement
assigneestobiu
createdAtSep 9, 2024, 12:10 AM
updatedAtSep 9, 2024, 1:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/5855
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 9, 2024, 1:26 AM

collection.Base: add protected for the map

Closed v8.1.0 enhancement
tobiu
tobiu commented on Sep 9, 2024, 12:10 AM

doc comments

tobiu added the enhancement label on Sep 9, 2024, 12:10 AM
tobiu assigned to @tobiu on Sep 9, 2024, 12:10 AM
tobiu referenced in commit e4f6cb6 - "collection.Base: add protected for items & map #5855" on Sep 9, 2024, 12:10 AM
tobiu closed this issue on Sep 9, 2024, 12:10 AM
tobiu reopened this issue on Sep 9, 2024, 1:23 AM
tobiu
tobiu Sep 9, 2024, 1:25 AM

did another dive into the code (was too long ago).

while map should be protected, items can get used directly:

    t.it('Create collection', t => {
        collection = Neo.create(Collection, {
            keyProperty: 'githubId',
            items: [
                {country: 'Germany',  firstname: 'Tobias', githubId: 'tobiu',         lastname: 'Uhlig'},
                {country: 'Germany',  firstname: 'Tobias', githubId: 'tobiu2',        lastname: 'Uhlig2'},
                {country: 'USA',      firstname: 'Rich',   githubId: 'rwaters',       lastname: 'Waters'},
                {country: 'Germany',  firstname: 'Nils',   githubId: 'mrsunshine',    lastname: 'Dehl'},
                {country: 'USA',      firstname: 'Gerard', githubId: 'camtnbikerrwc', lastname: 'Horan'},
                {country: 'Slovakia', firstname: 'Jozef',  githubId: 'jsakalos',      lastname: 'Sakalos'}
            ],
            sorters: [
                {direction: 'ASC',  property: 'firstname'},
                {direction: 'DESC', property: 'lastname'}
            ]
        });

    t.isStrict(collection.getCount(), 6, 'Collection has 6 items');
    t.isStrict(collection.map.size, 6, 'map has 6 items');
});

this changes for a data.Store => here we need data to convert input items into records.

tobiu referenced in commit 84dabca - "collection.Base: add protected for the map #5855" on Sep 9, 2024, 1:26 AM
tobiu changed title from collection.Base: add protected for items & map to collection.Base: add protected for the map on Sep 9, 2024, 1:26 AM
tobiu closed this issue on Sep 9, 2024, 1:26 AM