<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>设计模式 on 疯狂的技术宅</title><link>https://fe-tech.viewnode.com/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/</link><description>Recent content in 设计模式 on 疯狂的技术宅</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><lastBuildDate>Tue, 27 Apr 2021 10:00:00 +0800</lastBuildDate><atom:link href="https://fe-tech.viewnode.com/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/index.xml" rel="self" type="application/rss+xml"/><item><title>代码越写越乱？那是因为你没用责任链</title><link>https://fe-tech.viewnode.com/post/202104/27/</link><pubDate>Tue, 27 Apr 2021 10:00:00 +0800</pubDate><guid>https://fe-tech.viewnode.com/post/202104/27/</guid><description>目的 在开始学习责任链之前，先看一下在开发中常见的问题。下面是前端用来处理 API 错误码的代码： const httpErrorHandler = (error) =&amp;gt; { const errorStatus = error.response.status; if (errorStatus === 400) { console.log</description></item><item><title>用装饰器模式解决频繁修改的需求</title><link>https://fe-tech.viewnode.com/post/202104/25/</link><pubDate>Sun, 25 Apr 2021 10:00:00 +0800</pubDate><guid>https://fe-tech.viewnode.com/post/202104/25/</guid><description>目的 装饰器模式（Decorator Pattern） 的目的非常简单，那就是： 在不修改原有代码的情况下增加逻辑。 这句话听起来可能有些矛盾，既然都</description></item><item><title>用装饰器模式增强 fetch()</title><link>https://fe-tech.viewnode.com/post/202103/01/</link><pubDate>Mon, 01 Mar 2021 10:00:00 +0800</pubDate><guid>https://fe-tech.viewnode.com/post/202103/01/</guid><description>fetch() 很好用，但还能更好用 fetch() API使你可以在 Web 应用中执行网络请求。 fetch() 的用法非常简单：通过调用 fetch('/movies.json') 启动请求，请求完成后得到一个 Response 对象，然后从中提取数</description></item></channel></rss>