JsContainerFactory

JsContainerFactory

new JsContainerFactory(containerTypes)

A class to construct alternative sequential/mapping typings based on key type

Source:
Implements:

Use containers with the interfaces of the Array and ES6 Map classes as the constructed containers based on the type of the key to be used for indexing the container: a number indicates an Array and anything else uses a Map.

Pass an instance of this class as the containerFactory option when constructing a LensFactory. The container types to be used can be customized when constructing this factory.

Parameters:
Name Type Description
containerTypes Object
Properties
Name Type Attributes Default Description
Map function <optional>
Map

Map-equivalent container to construct

Array function <optional>
Array

Array-equivalent container to construct

Members

containerTypes :Object

Source:
Properties:
Name Type Description
Map function

The "map" type

Array function

The "array" type

The container type provided by this instance

Type:
  • Object

Methods

construct(keys) → {*}

Source:
Implements:

Construct the missing container

Parameters:
Name Type Description
keys Array

The keys up to and including the one into the missing container

Returns:

The missing container

Type
*