Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Your snippets
- #
- # Atom snippets allow you to enter a simple prefix in the editor and hit tab to
- # expand the prefix into a larger code block with templated values.
- #
- # You can create a new snippet in this file by typing "snip" and then hitting
- # tab.
- #
- # An example CoffeeScript snippet to expand log to console.log:
- #
- # '.source.coffee':
- # 'Console log':
- # 'prefix': 'log'
- # 'body': 'console.log $1'
- #
- # Each scope (e.g. '.source.coffee' above) can only be declared once.
- #
- # This file uses CoffeeScript Object Notation (CSON).
- # If you are unfamiliar with CSON, you can read more about it in the
- # Atom Flight Manual:
- # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
- '.source.js':
- 'disable eslint':
- "prefix": "esd"
- "body": "/* eslint-disable */"
- 'enable eslint':
- 'prefix': 'ese'
- 'body': '/* eslint-enable */'
- 'disable one line eslint':
- 'prefix': 'esl'
- 'body': '// eslint-disable-line'
- 'setTimeout function':
- "prefix": "timeout"
- "body": """
- setTimeout(() => {
- ${2}
- }, ${1:1000});
- """
- 'new Promise':
- "prefix": "prom"
- "body": """
- new Promise((resolve, reject) => ${1});
- """
- 'React container':
- 'prefix': 'rco'
- 'body': """
- import React, { Component } from 'react';
- import PropTypes from 'prop-types';
- import styled from 'styled-components';
- import { connect } from 'react-redux';
- class ${1:MyContainer} extends Component {
- static propTypes = {}
- render() {
- return (
- <div>
- <p>${1:MyContainer} screen</p>
- </div>
- );
- }
- }
- const mapStateToProps = (state) => {
- return {
- };
- };
- const mapDispatchToProps = (dispatch) => {
- return {
- };
- };
- export default connect(mapStateToProps, mapDispatchToProps)(${1:MyContainer});
- """
- 'React PureComponent':
- 'prefix': 'rpc'
- 'body': """
- import React, { PureComponent } from 'react';
- import PropTypes from 'prop-types';
- import styled from 'styled-components';
- export default class ${1:MyContainer} extends PureComponent {
- static propTypes = {}
- render() {
- return (
- <div>
- ${1:MyContainer} component
- </div>
- );
- }
- }
- """
- 'Jest test':
- 'prefix': 'jts'
- 'body': """
- import React from 'react';
- import { shallow } from 'enzyme';
- import 'jest-styled-components';
- import ${1:Component} from '.';
- const defaultProps = {};
- const setup = (props = defaultProps) => {
- const wrapper = shallow(<${1:Component} {...defaultProps} {...props} />);
- return {
- wrapper,
- };
- };
- describe('${1: Component} component', () => {
- it('should match snapshot', () => {
- const { wrapper } = setup();
- expect(wrapper).toMatchSnapshot();
- });
- });
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement