This extension contains snippets for TEAF development.
- React
- Typescript
Bellow are listed supported snippets
Trigger | Content |
---|---|
interfaceInstanceOf→ |
Creates a new Interface with support of instanceof comparison |
rfc→ |
Template for typed react functional component |
fwdRef→ |
Template for typed react forwardRef component |
useState→ |
Creates strongly typed useState with default value |
useEffect→ |
Creates template for useEffect with optional cleanup function |
destruct→ |
Object destructing |
tsig→ |
Creates typescript //@ts-ignore directive |
region→ |
Creates typescript //#region directive`` |
cl→ |
Creates console.log with //eslint-disable-next-line no-console directive |
Trigger | Content |
---|---|
actionCreator→ |
Creates a redux action creator |
actionInterface→ |
Creates an interface for redux action |
actionConstant→ |
Creates constant name for redux action |
selector→ |
Creates redux state selector |
createSel→ |
Creates reselect selector using createSelector |
Trigger | Content |
---|---|
expall→ |
Export all from package |
ims→ |
Import sinon package |
imf→ |
Import { whatever } from "some package " |
imrc→ |
Inserts imports for redux connected components |
Trigger | Content |
---|---|
omitContainerProps→ |
Creates template for connected component props |
stateProps→ |
Creates StateProps type |
dispatchProps→ |
Creates DispatchProps type |
connect→ |
Connects presentational component with props |
mapStateToProps→ |
Creates mapStateToProps variable used when connecting presentational components |
createMapStateToProps→ |
Creates function createMapStateToProps returning MapStateToProps |
mapDispatchToProps→ |
Creates mapDispatchToProps variable used when connecting presentational components |
Creates a new Interface with support of instanceof
comparison.
- Action Name (required)
- Extends (optional)
- Properties (optional)
- Methods (optional)
- Interfaces (optional)
- Conditions in
instanceof
(optional)
Template for typed react functional component.
- Component Name (required, name of file is default value)
- BemClassName (optional)
- Type of reference for React component (eg HTMLButtonElement, etc.)
- Props (optional,
children
default value) - JSDoc (optional)
Template for typed react forwardRef component.
- Component Name (required, name of file is default value)
- BemClassName (optional)
- Props (optional,
children
default value) - Props (optional,
children
default value) - JSDoc (optional)
Creates strongly typed useState
with default value.
Creates template for useEffect
with optional cleanup function.
- Dependency Array (optional)
- Cleanup function (optional)
- JSDoc (optional)
Picks members from an object and place them in standalone variables
- Object Name (required)
- Variable names (required)
- Rest properties (optional)
const { variable1, variable1, ...rest} = objectName;
Creates a redux action creator.
- Action Name (required)
- Payload (optional)
- Meta (optional)
- JSDoc (optional)
Creates an interface for redux action
- Action Name (required)
- Extends (optional)
- Payload (optional)
- JSDoc (optional)
Creates constant name for redux action
- Action Name (required)
export const ACTION_NAME = createActionType("ACTION_NAME");
Creates syntax for export all from package.
creates import for sinon package.
Creates type imports from react
and react-redux
a multiweb/types/react
packages needed for connecting componens (i.e. types MapStateProps
, IAppState
and others). Also creates import for presentational component and its props.
Snippet used when connection presentational component to redux. It creates props for connected component and omits props connected in StateProps or DispatchProps.
- Component Name (required, name of file is default value)
- Own props (optional)
- JSDoc (optional)
Creates StateProps
type picking props from presentational component.
Creates DispatchProps
type picking props from presentational component.
Connects presentational component with props.
Creates mapStateToProps
variable used when connecting presentational components.
- Component Name (required, name of file is default value)
- Create
StateProps
or skip them (optional) - Own component props entering mapStateToProps (optional)
Creates function createMapStateToProps
returning `MapStateToProps.
- Component Name (required, name of file is default value)
- Create
StateProps
or skip them (optional) - Own component props entering mapStateToProps (optional)
Creates mapDispatchToProps
variable used when connecting presentational components.
- Component Name (required, name of file is default value)
- Create
DispatchProps
or skip them (optional) - Own component props entering mapStateToProps (optional)