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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on Combine' @Published #329

Open
vinhnx opened this issue Apr 10, 2020 · 0 comments
Open

on Combine' @Published #329

vinhnx opened this issue Apr 10, 2020 · 0 comments
Labels

Comments

@vinhnx
Copy link
Owner

vinhnx commented Apr 10, 2020

tldr: @published is a wrapper for .objectWillChange, and with it, we don't need to call self.objectWillChange.send() manually on property's willSet/didSet

reference: https://twitter.com/luka_bernardi/status/1155944329363349504

In Beta 5 ObjectBinding is now defined in Combine as ObservableObject (the property wrapper is now @ObservedObject). There is also a new property wrapper @published where we automatically synthesize the objectWillChange publisher and call it on willSet.
It’ll objectWillChange.send() in the property willSet it’s defined on.
It just removes the boilerplate that you had to write before but otherwise behaves the same.

=> so @published in auto objectWillChange and call on willSet

reference: onmyway133/blog#487

@vinhnx vinhnx added the Combine label Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant