Skip to content

Commit

Permalink
Merge pull request #289 from emilhe/assign_fix
Browse files Browse the repository at this point in the history
Attempt at fixing possible bug in assign function
  • Loading branch information
emilhe authored Oct 7, 2023
2 parents 2531cf4 + edb24fc commit 01406d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ All notable changes to this project will be documented in this file.
### Changed

- Dependencies updated
- A few bugfixes

### Added

- Added `SerializationTransform` and `DataclassTransform`
- Dynamic prefixing is now applied recursively
- Inline JS functions created using `assign` are now re-used if the code is identical

## [1.0.3] - 31-07-23

Expand Down
5 changes: 5 additions & 0 deletions dash_extensions/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01406d3

Please sign in to comment.