Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Duck Snippet for TypeScriptNew to Visual Studio Code? Get it now.
Duck Snippet for TypeScript

Duck Snippet for TypeScript

Ky6uk

|
267 installs
| (0) | Free
Just the simple Duck snippet for React/Redux and TypeScript
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Duck snippet for React/Redux and TypeScript

The Duck snippet for React/Redux. This snippet uses TypeScript syntax.

The Snippet

Trigger Content
duck the snippet

Generated Code

interface Action {
  readonly type?: string;
}

const defaultState = {};

// Actions
const ACTION = 'duck-name/ACTION';

// Reducer
export default function reducer(state = defaultState, action: Action = {}) {
  switch (action.type) {
    case ACTION: {
      return state;
    }

    default: {
      return state;
    }
  }
}

// Action Creators

export function actionCreator() {
  return { type: ACTION };
}

License

MIT License © Roman Nuritdinov (Ky6uk)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft