2023 年度ã®åã®ã¨ã©ã¼ãã³ããªã³ã° ã«ã¤ãã¦æ¸ãããã æ¨æ¥Safe Data Fetching in Modern JavaScriptãèªãã§ãã¦ãfetch ã«éã£ã話ã§ã¯ãªããä¸å®¶è¨ããå 容ã ã£ãã®ã§æ¸ããããªã£ãã ããããããããã ã¨ãéå¹çã¨è¨ãããç¹ã¯ããã¨æãã®ã§ãã¿ããªã®ä¸å®¶è¨ãæãã¦æ¬²ããã 対象㯠Typescript ã§ã® ãµã¼ãã¼éçºæ³å®ã ããTS ã§ããã°ã¯ã©ã¤ã¢ã³ãéçºã«ãã»ã¨ãã©ã«å½ã¦ã¯ã¾ã話ã ã¨æãã ä¾å¤ã®ã¹ãã¼ã§ã¯ãªã Result åã使ã Result ã¯å¤±æãããããããªãã¨ããæèãä¸ãã¦ãããå ã¨ã©ã¼ãã³ããªã³ã°ã®æ¦ç¥ã¨ãã¦ä¾å¤ãæããã®ã§ã¯ãªããResult åãè¿ãããæ¹ãããã Result åã¨ããã®ã¯ export type Result<T, E> = Ok<T> | Err<E>; export interface Ok
{{#tags}}- {{label}}
{{/tags}}