Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

学习资料 & 技术文章分享 #23

Open
itboos opened this issue Jul 18, 2018 · 17 comments
Open

学习资料 & 技术文章分享 #23

itboos opened this issue Jul 18, 2018 · 17 comments

Comments

@itboos
Copy link
Owner

itboos commented Jul 18, 2018

一些学习的文档,资料整理

typescript 相关:

  1. 官网 https://github.com/Microsoft/TypeScript
  2. github: http://www.typescriptlang.org/
  3. 学习文档:
    https://ts.xcatliu.com/introduction/what-is-typescript.html
@itboos
Copy link
Owner Author

itboos commented Jul 19, 2018

文件上传:
是一款简单易用且功能强大的文件上传工具, 支持多种上传方式,包括html5, flash, silverlight, html4。会智能检测当前环境,选择最适合的方式,并且会优先采用Html5。
plupload.com

@itboos
Copy link
Owner Author

itboos commented Jul 23, 2018

跨域的相关文章:

  1. 不要再问我跨域问题了
    https://segmentfault.com/a/1190000015597029
  2. 浏览器的同源策略
    https://developer.mozilla.org/zh-CN/docs/Web/Security/Same-origin_policy
  3. Web测试之安全小坦克
    https://www.cnblogs.com/TankXiao/archive/2012/03/21/2337194.html

@itboos
Copy link
Owner Author

itboos commented Jul 26, 2018

flex兼容性写法

@itboos
Copy link
Owner Author

itboos commented Jul 28, 2018

@itboos
Copy link
Owner Author

itboos commented Jul 28, 2018

一些可以想看源码的小的库:

https://github.com/erikolson186/zangodb
MongoDB-like interface for HTML5 IndexedDB
https://erikolson186.github.io/zangodb/

@itboos
Copy link
Owner Author

itboos commented Jul 29, 2018

@itboos
Copy link
Owner Author

itboos commented Aug 1, 2018

@itboos
Copy link
Owner Author

itboos commented Aug 23, 2018

React.js 相关:

  1. 官方github: https://github.com/reactjs
  2. React 测试工具 https://github.com/airbnb/enzyme

@itboos
Copy link
Owner Author

itboos commented Sep 26, 2018

You-Dont-Need-Momentjs 第三方库替代Moment.js的github文章

@itboos
Copy link
Owner Author

itboos commented Oct 22, 2018

数据管理的另一个比较有名的库:
github-mobx
文章:
MobX 原理
mobx初探

@itboos
Copy link
Owner Author

itboos commented Nov 9, 2018

@itboos
Copy link
Owner Author

itboos commented Apr 21, 2019

reselect源码学习

深度解析Reselect库源码
reselect源码分析和最佳实践思考
reselect源码解读

  • 总结
  • 一个selector 对于计算依赖函数和结果计算函数 使用的是同一个 Memoize函数(默认为defaultMemoize函数)
  • 默认的记忆函数只能缓存一个参数和结果
  • 定义自己的选中器,使得selector 可以缓存多个数据
// 第一个参数是记忆函数,第二个参数常见的是给参数比较函数
var deepSeletor = createSelectorCreator(customMemoize,  ...rest)
  • 当调用selector 的时候,如果检测到传给selecttor的参数发生了变化(这里具体的检测方法取决于比较方法-即参数相等比较方法)
  // 原函数定义:
  export function createSelectorCreator(memoize, ...memoizeOptions) {
    return (...funcs) => {
        let recomputations = 0;         // 步骤二计算的次数(统计作用)
        const resultFunc = funcs.pop(); // 步骤二的结果函数,利用步骤一各个映射函数的结果作为输入,输出最终结果
        const dependencies = getDependencies(funcs); // 步骤一所涉及的映射函数

        /**
         * 将步骤二的结果函数也包装成记忆函数
         * 如果步骤二的函数被触发,将添加重新计算的次数
         */
        const memoizedResultFunc = memoize(
            function () {
                recomputations++; // 实际计算次数加1                
                return resultFunc.apply(null, arguments);
            },
            ...memoizeOptions // 这里把 调用 createSelectorCreator 的剩余参数传给了 记忆函数
        );

        // 如果选择器使用相同的参数进行调用,就无需进行步骤二的计算。
        const selector = memoize(function () {
            const params = [];                  // 要记忆的映射函数计算结果
            const length = dependencies.length; // 映射函数的个数
            for (let i = 0; i < length; i++) {                
                params.push(dependencies[i].apply(null, arguments));
            }
            // 把映射函数的计算结果传给步骤二的结果计算函数
            return memoizedResultFunc.apply(null, params); 
        });

        selector.resultFunc = resultFunc;     // 步骤二的结果计算函数
        selector.dependencies = dependencies; // 步骤一的映射计算函数数组
        selector.recomputations = () => recomputations; // 获得步骤二的结果计算函数的执行次数
        selector.resetRecomputations = () => recomputations = 0; // 重置步骤二的结果计算函数的执行次数
        return selector;
    };
};

@itboos
Copy link
Owner Author

itboos commented May 7, 2019

@itboos
Copy link
Owner Author

itboos commented Sep 14, 2019

@itboos
Copy link
Owner Author

itboos commented Sep 16, 2019

package.json

package.json doc

@itboos itboos changed the title 学习资料 学习资料 & 技术文章分享 Jan 6, 2020
@itboos
Copy link
Owner Author

itboos commented Jan 6, 2020

技术文章分享

Repository owner deleted a comment from dsudduth Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@itboos and others