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 coconut-specific @:forward #31

Open
gene-pavlovsky opened this issue Jul 3, 2018 · 1 comment
Open

Add coconut-specific @:forward #31

gene-pavlovsky opened this issue Jul 3, 2018 · 1 comment

Comments

@gene-pavlovsky
Copy link

I think coconut could benefit from it's own extended version of tink_lang's @:forward

Limitations of using @:forward now:

  • Doesn't generate an observable for the property
  • If the target field's properties allow write access (e.g. a simple VO with plain vars, marked @:observable), setters will be generated (on the other hand it can be argued that the VOs should be properly defined as immutable)
  • Haven't tried this: if properties are forwarded to a nested coconut model, is every kind of property forwarded correctly?
@serjek
Copy link

serjek commented Oct 31, 2020

proposition to add a @:proxy meta or something like this to forward observability for given (or all) props for nested models.

current workaround is a bit cumbersome:

@:observable var nested:NestedModel; //can change over time so binding to `model.nested.observables.prop` will not work anymore  once it is changed
@:computed var prop:NestedProp = nested.prop;
...

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

No branches or pull requests

2 participants