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.pull/21833/head
							parent
							
								
									7b882c6393
								
							
						
					
					
						commit
						1f219d8530
					
				| 
						 | 
				
			
			@ -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 New Issue