We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d7c2f6 commit ddfa9a5Copy full SHA for ddfa9a5
src/makeConfiguration.js
@@ -1,4 +1,9 @@
1
import _ from 'lodash';
2
+import Map from 'es6-map';
3
+
4
+let userConfigurationIndex;
5
6
+userConfigurationIndex = new Map();
7
8
/**
9
* @typedef CSSModules~Options
@@ -14,6 +19,12 @@ import _ from 'lodash';
14
19
export default (userConfiguration = {}) => {
15
20
let configuration;
16
21
22
+ configuration = userConfigurationIndex.get(userConfiguration);
23
24
+ if (configuration) {
25
+ return configuration;
26
+ }
27
17
28
configuration = {
18
29
allowMultiple: false,
30
errorWhenNotFound: true
@@ -31,5 +42,7 @@ export default (userConfiguration = {}) => {
31
42
configuration[name] = value;
32
43
});
33
44
45
+ userConfigurationIndex.set(userConfiguration, configuration);
46
34
47
return configuration;
35
48
};
0 commit comments