Skip to content

Commit

Permalink
Merge pull request #65 from hckrnews/feature/validation
Browse files Browse the repository at this point in the history
Better object creation
  • Loading branch information
w3nl authored Mar 9, 2021
2 parents c4b05b9 + 7709817 commit 1a26c3b
Show file tree
Hide file tree
Showing 6 changed files with 842 additions and 540 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const addressSchema = {

const Address = Obj({ schema: addressSchema })

const myAddress = new Address({
const myAddress = Address.create({
street: 'Abc',
number: 42,
postalCode: '1234AB',
Expand All @@ -44,7 +44,7 @@ Example usage without a schema:

```javascript
const ObjectWithoutSchema = Obj()
const flatter = new ObjectWithoutSchema({
const flatter = ObjectWithoutSchema.create({
a: 1,
b: 2,
c: [3, 4],
Expand Down
Loading

0 comments on commit 1a26c3b

Please sign in to comment.