Skip to content

Instantly share code, notes, and snippets.

@apiv
Last active November 1, 2017 00:43
Show Gist options
  • Save apiv/cb7a8684fefc9ca65b6ee9e9760f57f0 to your computer and use it in GitHub Desktop.
Save apiv/cb7a8684fefc9ca65b6ee9e9760f57f0 to your computer and use it in GitHub Desktop.
import React, { Component }
import { Entities } from 'lib/api/module'
@Entities({
contactResource: {
type: 'contact',
getId: (passedProps) => passedProps.contactId
}
})
class MyComponent extends Component { /* ... */ }
/*
* Usage
*/
const rendered = (
<MyComponent contactId={'contact_123'} />
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment