A set of snippets for Vim to work with Facebook's Relay library.
Requires vim-snipmate.
Use along vim-react-es6-snippets. Thanks Ben!
Use your preferred Vim plugin installation method. Vundle or Pathogen should be fine (I use Pathogen).
Within any Javascript or JSX file, you should be able to do the following:
(in insert mode)
rcc<Tab>
expanding to
export default Relay.createContainer(Component, {
fragments: {
propName: () => Relay.QL`
fragment on _ComponentConnection {
count,
edges {
node {
id,
text,
${ChildComponent.getFragment('child')}
}
}
}
`
},
});
relcc Relay.createContainer
relmut Relay.Mutation
relgf getFragment
relfrag fragment
relfragconn fragment on connection
relsu Relay.Store.update