<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vimniky Luo on Medium]]></title>
        <description><![CDATA[Stories by Vimniky Luo on Medium]]></description>
        <link>https://medium.com/@vimniky?source=rss-8bcbe621a4a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*693QvaInc3Rgf8p9.</url>
            <title>Stories by Vimniky Luo on Medium</title>
            <link>https://medium.com/@vimniky?source=rss-8bcbe621a4a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:24:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vimniky/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React 和 Redux 一直在 Bug 我的几个问题：]]></title>
            <link>https://medium.com/@vimniky/react-%E5%92%8C-redux-%E4%B8%80%E7%9B%B4%E5%9C%A8-bug-%E6%88%91%E7%9A%84%E5%87%A0%E4%B8%AA%E9%97%AE%E9%A2%98-3cb269edfb68?source=rss-8bcbe621a4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cb269edfb68</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Vimniky Luo]]></dc:creator>
            <pubDate>Sat, 16 Dec 2017 05:08:54 GMT</pubDate>
            <atom:updated>2018-01-01T04:07:40.694Z</atom:updated>
            <content:encoded><![CDATA[<p>- **问题一**： 在react里面你如何实现一个可以 TodoList，在ember 或vue里面呢 ？最后感觉 react + redux 的 todoMVC 是最啰嗦最难懂的。 不信大家可以点这 [TodoMVC](<a href="http://todomvc.com/">http://todomvc.com/</a>), 自己对比下. <br> <br>- **问题二**： 假设有一个稍复杂的表单，这时候你很自然的会把这个表单分成很多小的表单组件，然后再在一个父组件里面引用这些小表单组件。在 react 里面我们可以用如下方式去处理表单的state，把整个表单的状态保存在父组件中， 然后再父组件把 state 分发到子表单组件。假设这个大表单由 20 个小表单组件构成，我们需要写如下代码来同步子父表单的 state</p><p>1. 在父组件里创建 20 个类似 function() { this.setState(…) } 的函数 (写20遍）<br> 2. 在父组件中把这20个写好的setState函数通过 props 传到各个子表单组件（传20遍）<br> 3. 在各子表单组件中调用从父表单传下来的setState函数改变父组件状态（调用20遍）<br> 4. 上面的操作可以通过一些工具函数在某种程度上简化，但不会有本质的改变 — — 整个过程异常啰嗦，重复。<br> 5. 如果是用 redux， 把表单的状态保存在redux的store里面， 这个过程的啰嗦和重复程度还要再翻一倍。<br> 6. 正因为这种子父组件的状态交互的限制很多时候会迫使你写出，可读性，可维护性，可复用性，模块化很差的 Big Component。</p><p>- **问题三**： 在服务器端有一个资源， 这个资源有一个 transitioning 字段(boolean)，这个字段会受外界的影响而改变(如用户对该资源的操作，其它相关资源的变化)。当 transitioning 字段变成 `true` 的时候, 这个资源的状态(其它字段)可能会随时更新，这时，为了能在界面上显示这个资源的最新状态，我们需要去服务器轮询这个资源(没有WebSocket)。 出于性能考虑，当 transitioning 变成 false 的时候，我们需要停止轮询。 你会如何用 React + Redux 的组合来实现这样一个功能呢 ？</p><p>我发现上面的这些问题很难再 React 社区里面找到令我满意的解答， 如果你用 React + Redux 的组合，有些问题我甚至感觉有点无解。React+ Mobx 是在React 社区里面把上面的问题解决得最好的一个组合，但其实仔细想想就会发现： React + Mobx = 啰嗦版的 Vue / Ember / Angular。在 Vue / Ember / Angular 等 MVVM/类MVVM框架(提供双向数据)中，上面的问题其实都能轻而易举地解决。</p><p>我最喜欢的也觉得是 React 的最 powerful 的地方是它的 HOC (High Order Component), HOC能解决在其它框架里面要通过 Mixin，Service，Directive 等各种方式来解决的问题，而且要更简洁优雅。 其次我非常喜欢JSX的写法(Writing html in javascript, instead of writing javascript in html) 这比 Ember template，Vue template 的表达能力要强大得多 (虽然现在大多数其它前端框架也支持JSX的写法， 但都不是默认)。在其它方面，我觉得React都是现在主流框架里面做得比较差的。</p><p>自从FB搞出 Flux(单向数据流)后， 数据双向绑定(双向数据流)就成为了 React 社区吐槽的头号污点。如果你问为什么，他们会跟你说 ”Two way data binding is bad, it makes your application unpredictable”。从直觉上来说，这好像也没什么问题，应用的数据流向更清晰了，应用的状态当然也更可测了。 但仔细想想，应用的数据流向本来就是多向的，你现在要把一个多向的转换成单向，这中间肯定会有很多开销 (应用各模块之间的交互，通信)。如果把这些考虑进来，Flux 带来的问题比它解决的问题更多。用 Redux 很多时候会给我一种 “脱裤子放屁” 的感觉。 如果要讲应用状态的可预测性和可维护性，我觉得最重要的还是通过良好的封装， 模块化和组件化来解决。但 Redux 并没有在这方面给你任何帮助， 而且引入了太多不必要的概念。 说到底，Redux 只是一个带有特定访问/更新规则的全局变量。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cb269edfb68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use vector icons in your react-native project]]></title>
            <link>https://medium.com/@vimniky/how-to-use-vector-icons-in-your-react-native-project-8212ac6a8f06?source=rss-8bcbe621a4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8212ac6a8f06</guid>
            <category><![CDATA[icons]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Vimniky Luo]]></dc:creator>
            <pubDate>Wed, 04 May 2016 03:30:46 GMT</pubDate>
            <atom:updated>2016-11-11T08:20:15.457Z</atom:updated>
            <content:encoded><![CDATA[<p>Want to use vector icons in your reactive project ? There are a project right for your : <a href="https://github.com/oblador/react-native-vector-icons">react-native-vector-icons</a> . This project is awesome , but It’s documents are kind of tricky and unintuitive if you are not familiar with xcode .</p><h4>Installation :</h4><pre>$ # In your react-native project :<br>$ npm install react-native-vector-icons — save</pre><h4>How to add custom fonts to a React Native app in Xcode:</h4><ol><li>Create a new group Fonts within your Xcode project.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*-oYT5vvmliYCMIny7bHSvg.png" /></figure><p>notice : you can’t just create a normal folder . Your can tell weather a folder is a normal folder or a xcode Group by it’s color ( blue for normal folder and yellow for Group)</p><p>2. Drag the font files (./node_modules/react-native-vector-icons/Fonts/*.ttf) you want to use in your project to the Fonts group your just created .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*oHAyg6SgOcduHgfOrUGdmA.png" /></figure><p>3. Expand your project name folder within the main directory in your project and Edit Info.plist .</p><p>4. Add Fonts provided by application as a new key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSGQP3czYmh-AeatvM-PbQ.png" /></figure><p>5. Run Shift + Command + K to clean last build</p><p>6. Command + B to start a new build</p><p>7. And finally Command + R to run the application</p><p>If you still see the error Unrecognized font family restart your react packager.</p><p>now you should go to <a href="https://github.com/oblador/react-native-vector-icons">react-native-vector-icons</a> and see how to use it in detail .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8212ac6a8f06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[hello world]]></title>
            <link>https://medium.com/@vimniky/hello-world-c3b459d98e7?source=rss-8bcbe621a4a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3b459d98e7</guid>
            <category><![CDATA[mains]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Vimniky Luo]]></dc:creator>
            <pubDate>Tue, 26 Apr 2016 03:02:01 GMT</pubDate>
            <atom:updated>2016-04-26T03:02:01.257Z</atom:updated>
            <content:encoded><![CDATA[<p>hello world</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3b459d98e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>