Sask Vaccine Guide Code Docs
    Preparing search index...

    Interface iWelcomeFactService

    interface iWelcomeFactService {
        getRandomFact(language: "english" | "french"): Promise<WelcomeFact>;
        getRemoteFactList(): Promise<string[]>;
        saveFactList(list: WelcomeFact[]): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Async

      Gets a random fact from the WelcomeFact table.

      Parameters

      • language: "english" | "french"

        the language the fact should be in. Defaults to english !!NOT IMPLEMENTED!!

      Returns Promise<WelcomeFact>

      a promise containng a 'random' fact

      the WelcomeFact table must exist

      A fact must exist in the database.

      FaceQueryError if there is an issue with the WelcomeFaceEntity query.

    • Async

      Gets the fact list from the remote repo, this list contains string, lines that start with '#', these need to be discarded. (currently only enlish)

      Returns Promise<string[]>

      A list of string from the remote repo, these need to be parsed to remove comments

      Connected to the internet

      RemoteFactError there is an issue retrieving the remote fact list

    • Async

      Wipes the current fact list and saves the new one to the database.

      This works because the random fact is retrieved before the table is cleared.

      Parameters

      • list: WelcomeFact[]

        The list of facts to save into the database

      Returns Promise<void>

      list cannot be empty