• Type Parameters

    • MoizeableFn extends Moizeable

    Parameters

    Returns Moized<MoizeableFn, Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<MoizeableFn>;
        onCacheChange: OnCacheOperation<MoizeableFn>;
        onCacheHit: OnCacheOperation<MoizeableFn>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<Moizeable>;
        onCacheChange: OnCacheOperation<Moizeable>;
        onCacheHit: OnCacheOperation<Moizeable>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }>>

  • Type Parameters

    • MoizeableFn extends Moizeable
    • PassedOptions extends Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<MoizeableFn>;
          onCacheChange: OnCacheOperation<MoizeableFn>;
          onCacheHit: OnCacheOperation<MoizeableFn>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>

    Parameters

    Returns Moized<MoizeableFn, Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<MoizeableFn>;
        onCacheChange: OnCacheOperation<MoizeableFn>;
        onCacheHit: OnCacheOperation<MoizeableFn>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<Moizeable>;
        onCacheChange: OnCacheOperation<Moizeable>;
        onCacheHit: OnCacheOperation<Moizeable>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & PassedOptions>

  • Type Parameters

    • MoizedFn extends Moized<Moizeable, Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>

    Parameters

    Returns Moized<MoizedFn["fn"], Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<MoizedFn>;
        onCacheChange: OnCacheOperation<MoizedFn>;
        onCacheHit: OnCacheOperation<MoizedFn>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<Moizeable>;
        onCacheChange: OnCacheOperation<Moizeable>;
        onCacheHit: OnCacheOperation<Moizeable>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }>>

  • Type Parameters

    • MoizedFn extends Moized<Moizeable, Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>
    • PassedOptions extends Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<MoizedFn>;
          onCacheChange: OnCacheOperation<MoizedFn>;
          onCacheHit: OnCacheOperation<MoizedFn>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>

    Parameters

    Returns Moized<MoizedFn["fn"], Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<MoizedFn>;
        onCacheChange: OnCacheOperation<MoizedFn>;
        onCacheHit: OnCacheOperation<MoizedFn>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & Partial<{
        isDeepEqual: boolean;
        isPromise: boolean;
        isReact: boolean;
        isSerialized: boolean;
        isShallowEqual: boolean;
        matchesArg: IsEqual;
        matchesKey: IsMatchingKey;
        maxAge: number;
        maxArgs: number;
        maxSize: number;
        onCacheAdd: OnCacheOperation<Moizeable>;
        onCacheChange: OnCacheOperation<Moizeable>;
        onCacheHit: OnCacheOperation<Moizeable>;
        onExpire: OnExpire;
        profileName: string;
        serializer: Serialize;
        transformArgs: TransformKey;
        updateCacheForKey: UpdateCacheForKey;
        updateExpire: boolean;
    }> & PassedOptions>

  • Type Parameters

    • PassedOptions extends Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>

    Parameters

    Returns Moizer<PassedOptions>

Properties

clearStats: ((profileName?) => void)

Type declaration

    • (profileName?): void
    • Parameters

      • Optional profileName: string

      Returns void

collectStats: ((isCollectingStats?) => void)

Type declaration

    • (isCollectingStats?): void
    • Parameters

      • Optional isCollectingStats: boolean

      Returns void

compose: ((...moizers) => Moizer<Partial<{
    isDeepEqual: boolean;
    isPromise: boolean;
    isReact: boolean;
    isSerialized: boolean;
    isShallowEqual: boolean;
    matchesArg: IsEqual;
    matchesKey: IsMatchingKey;
    maxAge: number;
    maxArgs: number;
    maxSize: number;
    onCacheAdd: OnCacheOperation<Moizeable>;
    onCacheChange: OnCacheOperation<Moizeable>;
    onCacheHit: OnCacheOperation<Moizeable>;
    onExpire: OnExpire;
    profileName: string;
    serializer: Serialize;
    transformArgs: TransformKey;
    updateCacheForKey: UpdateCacheForKey;
    updateExpire: boolean;
}>>)

Type declaration

    • (...moizers): Moizer<Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>
    • Parameters

      • Rest ...moizers: (Moize<Partial<{
            isDeepEqual: boolean;
            isPromise: boolean;
            isReact: boolean;
            isSerialized: boolean;
            isShallowEqual: boolean;
            matchesArg: IsEqual;
            matchesKey: IsMatchingKey;
            maxAge: number;
            maxArgs: number;
            maxSize: number;
            onCacheAdd: OnCacheOperation<Moizeable>;
            onCacheChange: OnCacheOperation<Moizeable>;
            onCacheHit: OnCacheOperation<Moizeable>;
            onExpire: OnExpire;
            profileName: string;
            serializer: Serialize;
            transformArgs: TransformKey;
            updateCacheForKey: UpdateCacheForKey;
            updateExpire: boolean;
        }>> | Moizer<Partial<{
            isDeepEqual: boolean;
            isPromise: boolean;
            isReact: boolean;
            isSerialized: boolean;
            isShallowEqual: boolean;
            matchesArg: IsEqual;
            matchesKey: IsMatchingKey;
            maxAge: number;
            maxArgs: number;
            maxSize: number;
            onCacheAdd: OnCacheOperation<Moizeable>;
            onCacheChange: OnCacheOperation<Moizeable>;
            onCacheHit: OnCacheOperation<Moizeable>;
            onExpire: OnExpire;
            profileName: string;
            serializer: Serialize;
            transformArgs: TransformKey;
            updateCacheForKey: UpdateCacheForKey;
            updateExpire: boolean;
        }>>)[]

      Returns Moizer<Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>

deep: Moizer<{
    isDeepEqual: true;
}>

Type declaration

  • isDeepEqual: true
getStats: ((profileName?) => StatsObject)

Type declaration

    • (profileName?): StatsObject
    • Parameters

      • Optional profileName: string

      Returns StatsObject

infinite: Moizer<Partial<{
    isDeepEqual: boolean;
    isPromise: boolean;
    isReact: boolean;
    isSerialized: boolean;
    isShallowEqual: boolean;
    matchesArg: IsEqual;
    matchesKey: IsMatchingKey;
    maxAge: number;
    maxArgs: number;
    maxSize: number;
    onCacheAdd: OnCacheOperation<Moizeable>;
    onCacheChange: OnCacheOperation<Moizeable>;
    onCacheHit: OnCacheOperation<Moizeable>;
    onExpire: OnExpire;
    profileName: string;
    serializer: Serialize;
    transformArgs: TransformKey;
    updateCacheForKey: UpdateCacheForKey;
    updateExpire: boolean;
}>>
isCollectingStats: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

isMoized: ((value) => value is Moized<Moizeable, Partial<{
    isDeepEqual: boolean;
    isPromise: boolean;
    isReact: boolean;
    isSerialized: boolean;
    isShallowEqual: boolean;
    matchesArg: IsEqual;
    matchesKey: IsMatchingKey;
    maxAge: number;
    maxArgs: number;
    maxSize: number;
    onCacheAdd: OnCacheOperation<Moizeable>;
    onCacheChange: OnCacheOperation<Moizeable>;
    onCacheHit: OnCacheOperation<Moizeable>;
    onExpire: OnExpire;
    profileName: string;
    serializer: Serialize;
    transformArgs: TransformKey;
    updateCacheForKey: UpdateCacheForKey;
    updateExpire: boolean;
}>>)

Type declaration

    • (value): value is Moized<Moizeable, Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>
    • Parameters

      • value: any

      Returns value is Moized<Moizeable, Partial<{
          isDeepEqual: boolean;
          isPromise: boolean;
          isReact: boolean;
          isSerialized: boolean;
          isShallowEqual: boolean;
          matchesArg: IsEqual;
          matchesKey: IsMatchingKey;
          maxAge: number;
          maxArgs: number;
          maxSize: number;
          onCacheAdd: OnCacheOperation<Moizeable>;
          onCacheChange: OnCacheOperation<Moizeable>;
          onCacheHit: OnCacheOperation<Moizeable>;
          onExpire: OnExpire;
          profileName: string;
          serializer: Serialize;
          transformArgs: TransformKey;
          updateCacheForKey: UpdateCacheForKey;
          updateExpire: boolean;
      }>>

matchesArg: (<Matcher>(argMatcher) => Moizer<{
    matchesArg: Matcher;
}>)

Type declaration

    • <Matcher>(argMatcher): Moizer<{
          matchesArg: Matcher;
      }>
    • Type Parameters

      • Matcher extends IsEqual

      Parameters

      Returns Moizer<{
          matchesArg: Matcher;
      }>

matchesKey: (<Matcher>(keyMatcher) => Moizer<{
    matchesKey: Matcher;
}>)

Type declaration

    • <Matcher>(keyMatcher): Moizer<{
          matchesKey: Matcher;
      }>
    • Type Parameters

      • Matcher extends IsMatchingKey

      Parameters

      Returns Moizer<{
          matchesKey: Matcher;
      }>

maxAge: MaxAge
maxArgs: (<MaxArgs>(args) => Moizer<{
    maxArgs: MaxArgs;
}>)

Type declaration

    • <MaxArgs>(args): Moizer<{
          maxArgs: MaxArgs;
      }>
    • Type Parameters

      • MaxArgs extends number

      Parameters

      Returns Moizer<{
          maxArgs: MaxArgs;
      }>

maxSize: (<MaxSize>(size) => Moizer<{
    maxSize: MaxSize;
}>)

Type declaration

    • <MaxSize>(size): Moizer<{
          maxSize: MaxSize;
      }>
    • Type Parameters

      • MaxSize extends number

      Parameters

      Returns Moizer<{
          maxSize: MaxSize;
      }>

profile: (<ProfileName>(profileName) => Moizer<{
    profileName: ProfileName;
}>)

Type declaration

promise: Moizer<{
    isPromise: true;
}>

Type declaration

  • isPromise: true
react: Moizer<{
    isReact: true;
}>

Type declaration

  • isReact: true
serialize: Moizer<{
    isSerialized: true;
}>

Type declaration

  • isSerialized: true
serializeWith: (<Serializer>(serializer) => Moizer<{
    isSerialized: true;
    serializer: Serializer;
}>)

Type declaration

    • <Serializer>(serializer): Moizer<{
          isSerialized: true;
          serializer: Serializer;
      }>
    • Type Parameters

      • Serializer extends Serialize

      Parameters

      Returns Moizer<{
          isSerialized: true;
          serializer: Serializer;
      }>

shallow: Moizer<{
    isShallowEqual: true;
}>

Type declaration

  • isShallowEqual: true
transformArgs: (<Transformer>(transformer) => Moizer<{
    transformArgs: Transformer;
}>)

Type declaration

updateCacheForKey: (<UpdateWhen>(updateCacheForKey) => Moizer<{
    updateCacheForKey: UpdateWhen;
}>)

Type declaration

    • <UpdateWhen>(updateCacheForKey): Moizer<{
          updateCacheForKey: UpdateWhen;
      }>
    • Type Parameters

      • UpdateWhen extends UpdateCacheForKey

      Parameters

      Returns Moizer<{
          updateCacheForKey: UpdateWhen;
      }>