-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 some syntax sugar for observable models #4
Comments
To do that, we need to have an assembly post-processing task made with Mono.Cecil, it would iterate over types, find |
We also need a MSBuild task to easily add this post-processing, and for Unity we need to hook into the CompilationPipeline. |
I've played with this today and had some success, one thing that comes in mind is that we also want to expose underlying So far I have one idea how to implement it. Instead of the static class ModelExtensions
{
static Observable<T> GetObservable<T>(this Model model, string fieldName) {
return ((ModelInternal)model).GetObservable<T>(fieldName);
}
} So you can then do something like Internally, we'd have another special interface like If someone has better ideas how to do it, suggestions are welcome :) |
OK, for type-safety (and type inference!) we could also use the expression tree feature of C#, so the API would be something like |
FYI I'm experimenting with it in the model branch (beware - code is bad). |
I'd like to add something like coconut.data. There's no macros in C# so we'll have to do some IL weaving magic, but I'm pretty sure it would be possible to have something like:
and generate something like this from that:
The text was updated successfully, but these errors were encountered: