Coder Social home page Coder Social logo

xyz-data / vscode-react-redux-snippets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timothymclane/vscode-react-redux-snippets

0.0 2.0 0.0 306 KB

A small collection of react-redux snippets for VS Code that use ES6 and arrow functions

Home Page: https://marketplace.visualstudio.com/items?itemName=timothymclane.react-redux-es6-snippets

License: MIT License

TypeScript 100.00%

vscode-react-redux-snippets's Introduction

React-Redux ES6 Snippets for Visual Studio Code

React-Redux snippets for Visual Studio Code using ES6 and arrow functions.

Snippets

Trigger Content
reducer→ Redux reducer skeleton
container→ Redux container with mapStateToProps, mapDispatchToProps, mergeProps, and connect functions
mapStateToProps→ mapStateToProps arrow function
mapDispatchToProps→ mapDispatchToProps arrow function
mapDispatchToPropsBind→ mapDispatchToProps arrow function using bindActionCreators
mergeProps→ mergeProps arrow function
connect→ export default connect function
component→ functional React component
componentReturn→ functional React component with implicit return

Snippets support .js, .jsx, .ts, and .tsx extensions.

Usage

Type part of the snippet and hit Enter or Tab and the snippet will unfold.

container

camelCased identifiers support abbreviations, as shown below.

abbreviations

Settings

As of version 2.0.0, settings for loose and strict linter options are available. With loose, semicolons are generally omitted, while strict requires semicolons after every statement or function call. These settings can be accessed under reactReduxSnippets.

vscode-react-redux-snippets's People

Contributors

timothymclane avatar tzapu avatar

Watchers

James Cloos avatar xyzdata avatar

vscode-react-redux-snippets's Issues

react redux es6 snippets, better code style!

react redux es6 snippets

good

const initialState = {};
const allReducer = (state = initialState, action) => {
    switch (action.type) {
        case ACTION_TYPE_1:
            return state;
        case ACTION_TYPE_2:
            return state;
        default:
            return state;
    }
};


export {allReducer};
export default allReducer;

bad

const nameInitialState = {}
const name = (state = nameInitialState, action) => {
    switch (action.type) {
        case ACTION_TYPE_1:
            return state
        case ACTION_TYPE_2:
            return state
        default:
            return state
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.