LinkMap

LinkMap

This class is used to add an override to the j.app.next() call.

Constructor

# new LinkMap()

Contructor o initialize an empty map

Methods

# clear(all) → {void}

This clears the custom maps and resets it to the initial map (set with init())
Parameters:
Name Type Default Description
all boolean false if true, the map is full cleared. Otherwise it get reset to the initial map
Returns:
Type
void

# get(key) → {string|null}

Returns the target page for a mapping. If none is set with that name, null gets returned instead
Parameters:
Name Type Description
key string The name of the mapping to get
Returns:
the target page or null if no mapping exists with that name
Type
string | null

# hardAdd(arr) → {void}

Sets the given values and overrides existing ones. So if a mapping already exists, it gets removed and the new value gets set.
Parameters:
Name Type Description
arr object a key-value-array with mappings
Returns:
Type
void

# has(key) → {boolean}

Returns wether a page mapping exists or not
Parameters:
Name Type Description
key string The name of the mapping to get
Returns:
the target page or null if no mapping exists with that name
Type
boolean

# init(arr) → {void}

maps event names to pages (used to set an initial map)
Parameters:
Name Type Description
arr object a key-value-array with mappings
Returns:
Type
void

# remove(key) → {void}

Removes a single mapping by its key name
Parameters:
Name Type Description
key string The name of the mapping to remove
Returns:
Type
void

# set(key, value) → {void}

Sets a single mapping
Parameters:
Name Type Description
key string the name of the mapping
value string the target page to jump to
Returns:
Type
void

# softAdd(arr) → {void}

Sets the given values but doesn’t override existing ones. So if a mapping already exists, it is ignored.
Parameters:
Name Type Description
arr object a key-value-array with mappings
Returns:
Type
void