Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.11 KB

README.md

File metadata and controls

59 lines (42 loc) · 1.11 KB

vim-relay-es6-snippets

A set of snippets for Vim to work with Facebook's Relay library.

Requires vim-snipmate.

Use along vim-react-es6-snippets. Thanks Ben!

Installation

Use your preferred Vim plugin installation method. Vundle or Pathogen should be fine (I use Pathogen).

Usage

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')}
          }
        }
      }
    `
  },
});

Current list of snippets

relcc Relay.createContainer

relmut Relay.Mutation

relgf getFragment

relfrag fragment

relfragconn fragment on connection

relsu Relay.Store.update