Skip to content

Model compostion and Optional Properties #2814

Answered by bterlson
laduke asked this question in Q&A
Discussion options

You must be logged in to vote

We have OptionalProperties<T>, though not RequiredProperties which should be added I think, so you could write:

model Thing {
    ... RequiredProperties<ThingWritable>;
}

For now, you could do something like:

alias ThingProps = {
  prop1: boolean;
  prop2: boolean;
}

model ThingWritable {
   ... OptionalProperties<ThingProps>;
}

model Thing {
  ... ThingProps;
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by laduke
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants