AppleSauce
    Preparing search index...

    Class EventModels<TStore>

    Base class that provides model functionality for both sync and async event stores. This class can be extended by other packages to add additional helpful subscription methods.

    // In another package (e.g., applesauce-common)
    import { EventModels } from "applesauce-core/event-store";

    // Add methods to the prototype
    EventModels.prototype.mutes = function(user) {
    return this.model(MuteModel, user);
    };

    // Extend the type via module augmentation
    declare module "applesauce-core/event-store" {
    interface EventModels {
    mutes(user: string | ProfilePointer): Observable<Mutes | undefined>;
    }
    }

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    modelKeepWarm: number = 60_000

    How long a model should be kept "warm" while nothing is subscribed to it

    models: Map<ModelConstructor<any, any[], TStore>, Map<string, Observable<any>>> = ...

    A directory of all active models

    Methods