白马非白

心若没有栖息 到哪都是流浪


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

  • 留言

  • 导航

  • 搜索
close
白马非白

Redux

发表于 2017-02-24 | 分类于 Redux |

Redux is a predictable state container for JavaScript apps.
(If you’re looking for a WordPress framework, check out Redux Framework.)

It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time traveling debugger.

You can use Redux together with React, or with any other view library.
It is tiny (2kB, including dependencies).

build status
npm version
npm downloads
redux channel on discord
#rackt on freenode
Changelog #187

Learn Redux from its creator:
Part 1: Getting Started with Redux (30 free videos)

Part 2: Building React Applications with Idiomatic Redux (27 free videos)

Testimonials

“Love what you’re doing with Redux”
Jing Chen, creator of Flux

“I asked for comments on Redux in FB’s internal JS discussion group, and it was universally praised. Really awesome work.”
Bill Fisher, author of Flux documentation

“It’s cool that you are inventing a better Flux by not doing Flux at all.”
André Staltz, creator of Cycle

Before Proceeding Further

Also read:
You Might Not Need Redux

Developer Experience

I wrote Redux while working on my React Europe talk called “Hot Reloading with Time Travel”. My goal was to create a state management library with minimal API but completely predictable behavior, so it is possible to implement logging, hot reloading, time travel, universal apps, record and replay, without any buy-in from the developer.

Influences

Redux evolves the ideas of Flux, but avoids its complexity by taking cues from Elm.
Whether you have used them or not, Redux only takes a few minutes to get started with.

阅读全文 »
白马非白

React-router

发表于 2017-02-20 | 分类于 前端路由 |

React Router Travis npm package

React Router is a complete routing library for React.

React Router keeps your UI in sync with the URL. It has a simple API with powerful features like lazy code loading, dynamic route matching, and location transition handling built right in. Make the URL your first thought, not an after-thought.

Codecov
Discord

v4 Is Coming

The next version of React Router (v4) is in beta now.

v4 Documentation

Docs & Help

  • Tutorial – do this first!
  • Guides and API docs (v2, v3)
  • Troubleshooting guide
  • Changelog
  • Stack Overflow
  • CodePen boilerplate for bug reports

Older Versions:

  • 0.13.x - docs / guides / code / upgrade guide
  • 1.0.x - docs / code / upgrade guide

For questions and support, please visit our channel on Reactiflux or Stack Overflow.

Browser Support

阅读全文 »
白马非白

React

发表于 2017-02-20 | 分类于 React |

React · CircleCI Status Build Status Coverage Status npm version PRs Welcome

React is a JavaScript library for building user interfaces.

  • Declarative: React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
  • Component-Based: Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
  • Learn Once, Write Anywhere: We don’t make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code. React can also render on the server using Node and power mobile apps using React Native.

Learn how to use React in your own project.

Examples

We have several examples on the website. Here is the first one to get you started:

1
2
3
4
5
6
7
8
9
10
class HelloMessage extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
}
ReactDOM.render(
<HelloMessage name="John" />,
document.getElementById('container')
);

This example will render “Hello John” into a container on the page.

You’ll notice that we used an HTML-like syntax; we call it JSX. JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. We recommend using Babel with a React preset to convert JSX into native JavaScript for browsers to digest.

阅读全文 »
白马非白

React-router-redux

发表于 2017-02-19 | 分类于 前端框架 |

react-router-redux

npm version npm downloads build status

Keep your router in sync with application state :sparkles:

Formerly known as redux-simple-router

You’re a smart person. You use Redux to manage your application state. You use React Router to do routing. All is good.

But the two libraries don’t coordinate. You want to do time travel with your application state, but React Router doesn’t navigate between pages when you replay actions. It controls an important part of application state: the URL.

This library helps you keep that bit of state in sync with your Redux store. We keep a copy of the current location hidden in state. When you rewind your application state with a tool like Redux DevTools, that state change is propagated to React Router so it can adjust the component tree accordingly. You can jump around in state, rewinding, replaying, and resetting as much as you’d like, and this library will ensure the two stay in sync at all times.

This library is not necessary for using Redux together with React Router. You can use the two together just fine without any additional libraries. It is useful if you care about recording, persisting, and replaying user actions, using time travel. If you don’t care about these features, just use Redux and React Router directly.

Installation

1
npm install --save react-router-redux

How It Works

This library allows you to use React Router’s APIs as they are documented. And, you can use redux like you normally would, with a single app state. The library simply enhances a history instance to allow it to synchronize any changes it receives into application state.

history + store (redux) → react-router-redux → enhanced history → react-router

阅读全文 »
白马非白

画鸡

发表于 2017-02-17 | 分类于 唐伯虎 |

朝代:明代

作者:唐寅

头上红冠不用裁,满身雪白走将来。
平生不敢轻言语,一叫千门万户开。
白马非白

长恨歌

发表于 2017-02-17 | 分类于 情感 |

作者:白居易

朝代:唐代

汉皇重色思倾国,御宇多年求不得。杨家有女初长成,养在深闺人未识。
天生丽质难自弃,一朝选在君王侧。回眸一笑百媚生,六宫粉黛无颜色。
春寒赐浴华清池,温泉水滑洗凝脂。侍儿扶起娇无力,始是新承恩泽时。
云鬓花颜金步摇,芙蓉帐暖度春宵。春宵苦短日高起,从此君王不早朝。

承欢侍宴无闲暇,春从春游夜专夜。后宫佳丽三千人,三千宠爱在一身。
金屋妆成娇侍夜,玉楼宴罢醉和春。姊妹弟兄皆列土,可怜光彩生门户。
遂令天下父母心,不重生男重生女。骊宫高处入青云,仙乐风飘处处闻。
缓歌慢舞凝丝竹,尽日君王看不足。渔阳鼙鼓动地来,惊破霓裳羽衣曲。
阅读全文 »
白马非白

离别与重逢

发表于 2017-02-17 | 分类于 所感所想 |

题记:暂时的离别是为了再次重逢时的感动

离别

离别的时候
每一句话都是那么重
缓缓地扣击着我们的心灵
窗被敲开了
我们诉说着回忆中的快乐
回想著一张张可爱的笑脸
院子里,操场上
充满了甜甜的空气
阅读全文 »
墨含

墨含

你若安好便是晴天

7 日志
7 分类
5 标签
RSS
GitHub Weibo
Links
  • Todos
  • 小溪官网
  • idvert
  • detail
  • trade
  • home
  • cloud-site
  • C-life
  • C-life智能云平台
  • C-lift后台管理
  • 富金机网
  • Tropical-Resorts
  • admin
  • guide
  • 前端导航
© 2017 墨含
由 Hexo 强力驱动
主题 - NexT.Muse