ActionMap allows us to use iterables (of key-value pairs) in place of objects in call, set and del functions (and corresponding classes). This can be useful for building virtual objects which are only used with the calls but never held fully in memory at any time, improving memory performance.

Example

import { call, ActionMap } from 'apption'
let arr1 = [1, 2, 3], arr2 = [1, 2, 3], arr3 = [1, 2, 3];
const actions = new ActionMap([[ 'push', [arr1, arr3]], ['unshift', [arr2]]]);
call(actions, 20, 21);
console.log(arr1) // [1, 2, 3, 20, 21]
console.log(arr2) // [20, 21, 1, 2, 3]
console.log(arr3) // [1, 2, 3, 20, 21]

Constructors

Properties

Constructors

  • Parameters

    • entries: Iterable<[IKey, any]>

    Returns ActionMap

Properties

entries: Iterable<[IKey, any]>