動くコード図鑑技術記事現場の渡り方キャリア論すべての記事About
TypeScript

Action

出典: Typescript×ReduxでStateがundefinedに?確認すること!ソースコードを解説 / Action

Action (typescript)#f6e047b97c21
import {Action} from 'redux'
 
export enum	ActionNames{
	Increment = 'inc',
	Decrement = 'dec'
}
 
export interface IIncrement extends Action{
	type : ActionNames.Increment
}
 
export interface IDecrement extends Action {
	type : ActionNames.Decrement;
}
 
export const IncrementAmount = () : IIncrement => ({type : ActionNames.Increment});
export const DecrementAmount = () : IDecrement => ({type : ActionNames.Decrement});
 
export type ActionType = IIncrement | IDecrement;
▸ この snippet は実行結果未収録
▸ 実行結果は未収録です
  • id: #f6e047b97c21
  • lines: 19
  • extracted: 2026-06-10

Source収録記事

この snippet は記事の「ソースコードを解説 / Action」セクションに登場する。コードの前後の文脈・ハマりどころの解説は記事本文で。

同じ記事から

11
図鑑トップ