看 flux 官网的文档还是有些云里雾里的,需要一个 demo 来帮助在实践中进行理解,果断要选择 todomvc。
todomvc 已经有了各种各样框架的实现版本,在 flux 官方仓库中也提供了 tomomvc 的 flux� 版本,拿它作为入门学习 flux 的 demo 是相当不错的。
本文仅仅使用 todomvc 作为一个例子来说明,不会对其进行具体的代码解析。
| cat /dev/urandom | head -1 | md5sum | cut -c 1-16 |
| function _isSupportInputDate() { | |
| var input = document.createElement('input') | |
| input.type = 'date' | |
| input.value = 'test' // input[type=date] can't set value as a string. | |
| return input.value !== 'date' | |
| } |
| @font-face { | |
| font-family: 'iconfont'; | |
| src: url('iconfont.eot'); /* IE9*/ | |
| src: url('iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |
| url('iconfont.woff') format('woff'), /* chrome、firefox */ | |
| url('iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ | |
| url('iconfont.svg#uxiconfont') format('svg'); /* iOS 4.1- */ | |
| } |
| { | |
| "React": "src/React.js", | |
| "ReactVersion": "src/ReactVersion.js", | |
| "ReactComponentWithPureRenderMixin": "src/addons/ReactComponentWithPureRenderMixin.js", | |
| "ReactFragment": "src/addons/ReactFragment.js", | |
| "ReactWithAddons": "src/addons/ReactWithAddons.js", | |
| "LinkedStateMixin": "src/addons/link/LinkedStateMixin.js", | |
| "ReactLink": "src/addons/link/ReactLink.js", | |
| "renderSubtreeIntoContainer": "src/addons/renderSubtreeIntoContainer.js", | |
| "shallowCompare": "src/addons/shallowCompare.js", |
Susy 是一个用于创建自定义布局结构的 css 工具集合,它并不提供现成的 className 来给你使用,而是提供 sass 的 function/mixins 来帮助你创建页面的布局结构。
Susy 作为一个 sass 工具库,使用的时候 @import 进来便是,可以使用 npm/bower 来下载。
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Scroll test</title> | |
| </head> | |
| <body> | |
| <div style="height:1800px"> | |
| hello world | |
| </div> |
| #!/bin/bash | |
| # 只检查提交的 src 下的 js 文件 | |
| eslint=./node_modules/.bin/eslint | |
| result=0 | |
| for file in `git diff --cached --name-only` | |
| do | |
| if [[ $(echo $file | grep -E "^src\/.*\.js$" | wc -l) -gt 0 ]]; | |
| then |