src/Utility/Store.js
/**
     * Apply a function to the Store and returns a new Store.
     * Usable over: `map`, `filter`, `toArray`.
     * Using apply with toArray is pretty much "cloning" the Store.
     *
     * @param {String} key - The property to use as key for the new Store
     * @param {String} func - The function name to apply to the Store
     * @param {...any} args - All the arguments that need to be applied to the function
     * @returns {Store<T>} A new Store modified by the apply call
     * @memberof Store
     */
Apply a function to the Store and returns a new Store.


Apply a function to the Store and returns a new Store .
apply(key, func, ...args) {
        if (![
            'map',
            'filter',
            'toArray',
        ].includes(func) ) {
            throw new AxonError(`You can't use apply on function: ${func}.`, 'Store');
        }
        return new Store(new Map(this[func](...args).map(e => [e[key], e] ) ) );
    }
apply ( key , func , ... args ) { if ( ! [ 'map' , 'filter' , 'toArray' , ] . includes ( func ) ) { throw new AxonError ( ` ${ func } ` , 'Store' ) ; } return new Store ( new Map ( this [ func ] ( ... args ) . map ( e => [ e [ key ] , e ] ) ) ) ; }
Apply a function to the Store and returns a new Store.
Apply a function to the Store and returns a new Store .