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

Add an Observable macro implementation example. #6

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

hborla
Copy link
Contributor

@hborla hborla commented Feb 3, 2023

Implements the Observable use-case for type wrappers as a combination of member, member attribute, and accessor macros.

More information on the observation use case on the Swift Forums here: https://forums.swift.org/t/pitch-observation/62051

@@ -47,3 +47,44 @@ public macro wrapStoredProperties(_ attributeName: String) = #externalMacro(modu
@attached(member, names: named(_storage))
@attached(memberAttribute)
public macro DictionaryStorage() = #externalMacro(module: "MacroExamplesPlugin", type: "DictionaryStorageMacro")

public protocol Observable {}
Copy link
Owner

Choose a reason for hiding this comment

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

We should probably start splitting up this library into multiple files, but this looks great

@DougGregor DougGregor merged commit f5e6cb5 into DougGregor:main Feb 3, 2023
@hborla hborla deleted the observable-macro branch February 3, 2023 23:08
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.

2 participants