We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b565cbc commit 9a65658Copy full SHA for 9a65658
dash/development/base_component.py
@@ -14,18 +14,16 @@ class ComponentRegistry:
14
"""Holds a registry of the namespaces used by components."""
15
16
registry = set()
17
- __dist_cache = collections.defaultdict(dict)
+ __dist_cache = {}
18
19
@classmethod
20
def get_resources(cls, resource_name):
21
cached = cls.__dist_cache.get(resource_name)
22
- current_len = len(cls.registry)
23
24
- if cached and current_len == cached.get('len'):
25
- return cached.get('resources')
+ if cached:
+ return cached
26
27
- cls.__dist_cache[resource_name]['resources'] = resources = []
28
- cls.__dist_cache[resource_name]['len'] = current_len
+ cls.__dist_cache[resource_name] = resources = []
29
30
for module_name in cls.registry:
31
module = sys.modules[module_name]
0 commit comments