TagRegistry
Index
Functions
addCommonObject
Appends object to group to use in iterator and filtering functions like TagRegistry.getAllWith, etc.
Parameters
group: string
obj: any
tags: string[]
primary tags to be added for object
Returns void
addTagFactory
Tag factory determines additional tags, which should be added for specific object in group.
Parameters
group: string
factory: TagFactory<any>
Returns void
addTagFor
Appends primary tag for object in group.
Parameters
group: string
obj: any
tag: string
primary tag to be added for object
useExistingObject: boolean
do not append object to group
Returns void
addTagsFor
Appends primary tags for object in group; regardless of whether object is in group or not, tags will be added.
Parameters
group: string
obj: any
tags: string[]
primary tags to be added for object
useExistingObject: boolean
do not append object to group
Returns void
getAllWith
Iterates over existing common objects in group added via TagGroup.addCommonObject and collects objects matched predicate to list.
Parameters
group: string
predicate: TagPredicate<any>
Returns any[]
getAllWithTag
Fetches objects in group which has presented tag.
Parameters
group: string
tag: string
Returns any[]
getAllWithTags
Fetches objects in group which have all of presented tags.
Parameters
group: string
tags: string[]
Returns any[]
getOrCreateGroup
Gets or creates a new tag group to append tags for any objects.
Parameters
name: string
Returns TagGroup
getTagsFor
Fetches object tags in fixed order: primary tags added via TagRegistry.addTagsFor, serialized tags from object
_tagsproperty, tags added from TagRegistry.addTagFactory.Parameters
group: string
obj: any
Returns string[]
removeCommonObject
Removes object from group, so it no longer can be fetched via TagRegistry.getAllWith, etc.
Parameters
group: string
obj: any
Returns void
removeTagsFor
Removes primary tags from object in group.
Parameters
group: string
obj: any
tags: string[]
primary tags to be removed from object
Returns void
Tag system allows you to assign tags to objects and put them into groups for further object search.
Use constant to define group in global scope to reuse/export it:
Obtain tag group automatically via registry: