/** * Check if given value is a memoized selector function * @param {any} func * @returns {boolean} true - if it was created with `createSelector` from 'reselect' library */ export function isSelector(func: any): boolean; /** * Selector Decorator to turn all class static property functions into Memoized Functions * * @see: `createSelector` in reselect library for docs * @note: make sure to avoid arrow function when reusing selectors * * @example: * // selectors.js * *@selector(NAME) * export default class select { * * // Shorthand declaration syntax (`this` is undefined) * static activeRoute = () => [ * (state) => get(state, `${NAME}.location.pathname`), * (pathname) => pathname * ] * * // Reusing selectors declaration syntax (`this` is the `select` class instance) * static activeUri = function () { * // noinspection JSPotentiallyInvalidUsageOfClassThis * return [ * // Reusing selector defined above (order of declaration matters) * this.activeRoute, * // This function will execute every time the `state` object changes its reference, * // but it does not execute if we mutate `state` object without changing reference. * (state) => get(state, `${this.NAME}.location.id`), * // The last function only executes when any of its arguments changes reference * (route, id) => route.split('/').pop() * ] * } * } * @param {String} NAME - module's namespace * @param {Number} [maxTime] - milliseconds, to be considered slow (highlights execution time as red), default is 5 ms * @returns {Function} decorator - that transforms given class' static properties */ export function selector(NAME: string, maxTime?: number | undefined): Function; export * from "reselect"; export default selector;