diff --git a/CHANGELOG.md b/CHANGELOG.md index d698399..7bbba1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [1.0.4] - 31-07-23 + +### Changed + +- Added `SerializationTransform` and `DataclassTransform` + ## [1.0.3] - 31-07-23 ### Added diff --git a/dash_extensions/javascript.py b/dash_extensions/javascript.py index d91b0ab..4c3c648 100644 --- a/dash_extensions/javascript.py +++ b/dash_extensions/javascript.py @@ -25,6 +25,11 @@ def __call__(self, var): return variable(*all_args) def add(self, src, name=None): + # Check if the function already exists. + for key in self.f_map: + if name is None and self.f_map[key] == src: + return key + # Otherwise add it. name = f"function{len(self.f_map)}" if name is None else name self.f_map[name] = src return name