-
Notifications
You must be signed in to change notification settings - Fork 20
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 documentation #11
Conversation
|
||
## Coercion | ||
|
||
Structure does type coercion based on the declared [schema](#schema). It's important to note that it __never__ coerces `undefined` and it also won't coerce if the value is already of the declared type (except for arrays, we'll talk more about this soon). Let's break the coercion into 3 categories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for schema
have to be fixed to point to #schema-concept
.
generateRandomBook() { | ||
return '...'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's something missing here, maybe it was supposed to be this?
const User = attributes(userSchema)(class User {
// ...
});
|
||
## Getting started | ||
|
||
`npm install structure` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add --save
option here? And maybe an example using Yarn?
Fix `defaultValue` to `default`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure changing to default is better for readability and understanding of the property?
@fernandofleury I think it is, using |
No description provided.