feat(config): add set to config

This commit is contained in:
Manu Mtz.-Almeida
2018-03-22 18:58:51 +01:00
parent eb0ff2f09d
commit 69a6f8d012
2 changed files with 7 additions and 1 deletions

View File

@@ -44,9 +44,14 @@ export function createConfigController(configObj: any, platforms: PlatformConfig
return isNaN(val) ? (fallback !== undefined ? fallback : NaN) : val;
}
function set(key: string, value: string) {
configObj[key] = value;
}
return {
get,
getBoolean,
getNumber
getNumber,
set
};
}

1
core/src/index.d.ts vendored
View File

@@ -114,6 +114,7 @@ export interface Config {
get: (key: string, fallback?: any) => any;
getBoolean: (key: string, fallback?: boolean) => boolean;
getNumber: (key: string, fallback?: number) => number;
set: (key: string, value: any) => void;
}
export type CssClassMap = { [className: string]: boolean };