Skip to content

Instantly share code, notes, and snippets.

@jstejada
jstejada / fragments.js
Last active February 11, 2019 06:45 — forked from bcherny/fragments.js
/*
Nice things about this approach:
- No need to expose $refs to users. Just use regular IDs instead.
- No need for double-composition (just compose React components, not queries).
- Composition becomes less magical (since we're passing regular IDs around).
- Collapse Query and Fragment concepts into Query.
- Take advantage of existing template strings to pass in query variables.