Frontmatter
| id | 5855 |
| title | collection.Base: add protected for the map |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Sep 9, 2024, 12:10 AM |
| updatedAt | Sep 9, 2024, 1:26 AM |
| githubUrl | https://github.com/neomjs/neo/issues/5855 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Sep 9, 2024, 1:26 AM |
collection.Base: add protected for the map
tobiu assigned to @tobiu 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
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 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
doc comments