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 documentation #11

Merged
merged 41 commits into from
Jan 3, 2017
Merged

Add documentation #11

merged 41 commits into from
Jan 3, 2017

Conversation

fernandofleury
Copy link
Collaborator

No description provided.


## 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:
Copy link
Owner

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 '...';
}
}
Copy link
Owner

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`
Copy link
Owner

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?

Copy link
Collaborator Author

@fernandofleury fernandofleury left a 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?

@talyssonoc
Copy link
Owner

@fernandofleury I think it is, using defaultValue may not make it clear to the user the it can also be a function, the user may think that the only thing that can be passed to this property is an action value. What do you think?

@fernandofleury fernandofleury merged commit 09f9c9c into master Jan 3, 2017
@talyssonoc talyssonoc deleted the docs branch January 4, 2017 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants