Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: expose data controller onUpdate hook #336

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

nancywu1
Copy link
Contributor

@nancywu1 nancywu1 commented Apr 11, 2024

expose on update hook so Swift plugins can recieve data changes

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Version

Published prerelease version: 0.7.3-next.0

Changelog

馃悰 Bug Fix

Authors: 2

Comment on lines 129 to 130
let hookValue = try? JSONDecoder().decode(T.self, from: val),
let hookValue2 = try? JSONDecoder().decode(U.self, from: val2)
Copy link
Contributor

Choose a reason for hiding this comment

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

probably trivial perf, but we can just make one decoder and reuse it


public struct Update: Decodable {
/** The updated binding */
var binding: BindingInstance
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a regression test also to make sure that binding is decoded properly with a value?

@nancywu1 nancywu1 merged commit 3fae7c0 into main Apr 12, 2024
9 checks passed
@nancywu1 nancywu1 deleted the 331-expose-on-update-hook-ios branch April 12, 2024 14:44
@intuit-svc intuit-svc mentioned this pull request Apr 30, 2024
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.

None yet

2 participants