Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kutase authored May 4, 2018
1 parent 2649dd0 commit c55fe5e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ serialize.add('user', {
  }
})

serialize.add('testGetters', {
attributes: ['gallery'],
formatters: {
// Formatter can have getter function for data extraction
gallery: { $ref: 'photo', getter: (data) => data.testPhotos.map(el => el.photo) }
}
})

serialize.add('photo', {
  attributes: ['url'],
  formatters: {
Expand Down

0 comments on commit c55fe5e

Please sign in to comment.