File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,18 @@ const getConfigParam = key => {
39
39
return JSON . parse ( JSON . stringify ( get ( config , key , get ( getDefaults ( ) , key ) ) ) )
40
40
}
41
41
42
+ // Method to grab a config value for a particular component.
43
+ // Returns a deep clone (immutable) copy
44
+ const getConfigComponent = ( cmpName , key = null ) => {
45
+ if ( key ) {
46
+ // Return the particular config value for key for specified component
47
+ return getConfigParam ( `${ cmpName } .${ key } ` )
48
+ } else {
49
+ // return the components full config
50
+ return getConfigParam ( cmpName ) || { }
51
+ }
52
+ }
53
+
42
54
// Convenience method for getting all breakpoint names
43
55
const getBreakpointsAll = ( ) => {
44
56
const bpts = getConfigParam ( 'breakpoints' )
@@ -68,6 +80,7 @@ const getBreakpointsDown = () => {
68
80
export {
69
81
getDefaults ,
70
82
getConfigParam ,
83
+ getConfigComponent ,
71
84
getBreakpointsAll ,
72
85
getBreakpointsUp ,
73
86
getBreakpointsDown
You can’t perform that action at this time.
0 commit comments