Skip to content

LG-11285: Add helper function to clean up observable properties#10809

Merged
zachmargolis merged 12 commits intoLG-11285-handle-extra-acuant-callbackfrom
margolis-observable-property
Jun 13, 2024
Merged

LG-11285: Add helper function to clean up observable properties#10809
zachmargolis merged 12 commits intoLG-11285-handle-extra-acuant-callbackfrom
margolis-observable-property

Conversation

@zachmargolis
Copy link
Copy Markdown
Contributor

Alternative approach to #10762

Switches approaches to cleaning up callbacks in useEffect()

Copy link
Copy Markdown
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a cleaner approach. Tested with document capture on mobile and did not trigger the TypeError we've been seeing.

Copy link
Copy Markdown
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually just noticed we still need to remove the resetObservableProperty method and call.

Copy link
Copy Markdown
Contributor

@solipet solipet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks!

@zachmargolis zachmargolis merged commit d12ad0f into LG-11285-handle-extra-acuant-callback Jun 13, 2024
@zachmargolis zachmargolis deleted the margolis-observable-property branch June 13, 2024 13:07
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect this folder to contain higher-order React components, which this isn't. I might have suggested this be implemented as a hook instead, like useDefinedProperty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok! I can clean it up to be a hook, I was just guessing what to call it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup PR: #10838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants