Philippe Hausler on Nostr: So neat little trick that doesn’t have much for documentation just yet: if you make ...
So neat little trick that doesn’t have much for documentation just yet: if you make an ObservableObject conform to Observable (not the macro) your published properties work as if they were part of an observable type. That means you can now have ObservableObjects in your Observable types. The one caveat is that properties that aren’t Published won’t participate. This should help with folks trying to migrate from Combine to Observation.
Published at
2024-06-11 00:33:24Event JSON
{
"id": "b510d92def10786219d2c63daaa1158efdfaec0a197eb36c7a787158804ef059",
"pubkey": "e8eeb2c983040527845f97b04dad7c9fdd8bcf395ca834aa1903b9fd3cf98732",
"created_at": 1718066004,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/phausler/statuses/112595173657946895",
"activitypub"
]
],
"content": "So neat little trick that doesn’t have much for documentation just yet: if you make an ObservableObject conform to Observable (not the macro) your published properties work as if they were part of an observable type. That means you can now have ObservableObjects in your Observable types. The one caveat is that properties that aren’t Published won’t participate. This should help with folks trying to migrate from Combine to Observation.",
"sig": "1c2324c9c86a0ccfd0e430d71653cb5f35eb0c957f71f9e190f5900316de62a751616a4a41b2b51471625c6e5debc70bf0f3789c183af57c7bba65bc9d4a29c2"
}