Provides an accessible JS object that is updated reactively from all or subset of TJSGameSettings stores. Accessors are provided to directly get / set current setting data. Using a setter will update the setting and backing store.

Note: You can create a JSDoc / @typedef to apply with @type and achieve typing support in IDEs for the customizable live settings instance. Please see the example at the end of this source file on how to accomplish this task.

TJSLiveGameSettings is also a readable Svelte store essentially providing a customizable derived store of all settings tracked.

Note: When using from JS a second subscriber function argument is the key that was updated. From Svelte: Use 'lastKey' accessor to retrieve the last updated key.

Constructors

  • Creates a live binding against the setting stores. All settings are configured by default, but can also be filtered by setting key with inclusive / exclusive Sets.

    Parameters

    • gameSettings: TJSGameSettings

      A game settings instance to subscribe to...

    • Optionaloptions: {
          exclude?: Set<string>;
          include?: Set<string>;
      }

      TJSLiveGameSettings options.

      • Optionalexclude?: Set<string>

        A Set of setting keys to exclude from subscribing.

      • Optionalinclude?: Set<string>

        A Set of setting keys to include from subscribing.

    Returns TJSLiveGameSettings

Accessors

  • get lastKey(): string
  • Returns string

    Last updated setting key.

Methods

  • Protected

    Override to respond to setting update.

    Parameters

    • key: string

      The setting / local key that updated.

    Returns void

  • Destroys this instance of TJSLiveGameSettings and unsubscribes from all game setting stores.

    Returns void

  • Returns an iterator / generator of all setting entries.

    Returns IterableIterator<[key: string, value: any], any, any>

    An iterator returning setting entries.

  • Returns an iterator / generator of all setting keys.

    Returns IterableIterator<string, any, any>

    An iterator returning setting keys.

  • Returns a string / JSON stringify of the current setting data.

    Returns string

    Tracked setting data.

  • Returns an iterator / generator of all values.

    Returns IterableIterator<any, any, any>

    An iterator returning setting values.