mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
Simple support for generics off the settings store
Ideally the settings store returns the right type, but for now we can feed it the type we need/expect.
This commit is contained in:
parent
7b882c6393
commit
1f219d8530
1 changed files with 1 additions and 1 deletions
|
@ -276,7 +276,7 @@ export default class SettingsStore {
|
|||
* @param {boolean} excludeDefault True to disable using the default value.
|
||||
* @return {*} The value, or null if not found
|
||||
*/
|
||||
public static getValue(settingName: string, roomId: string = null, excludeDefault = false): any {
|
||||
public static getValue<T = any>(settingName: string, roomId: string = null, excludeDefault = false): T {
|
||||
// Verify that the setting is actually a setting
|
||||
if (!SETTINGS[settingName]) {
|
||||
throw new Error("Setting '" + settingName + "' does not appear to be a setting.");
|
||||
|
|
Loading…
Reference in a new issue