npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

freed-framework

v1.0.41

Published

大致的工作流程 1. App.jsx 2. 调用 actions/*.js 3. actions 调用 fetch(axios.js) 发送数据请求

Downloads

3

Readme

大致的工作流程

  1. App.jsx
  2. 调用 actions/*.js
  3. actions 调用 fetch(axios.js) 发送数据请求

切记不要在 constructor 或者 组件的任何位置setState,state全部在reducer初始化


const mapDispatchToProps = (dispatch) => bindActionCreators({
  increase,
  decrease
}, dispatch);

@connect(state => state, mapDispatchToProps)

可以用 ES7 的方式简化为

nginx 配制, BrowserHistory location / { try_files $uri /index.html; }

Redux三大原则:

1、单一数据源,这个应用的state被存储在一棵object tree中,并且这个object tree只存在于唯一的Store中。

2、state是只读的,唯一改变state的方法就是触发action,action是一个用于描述已发生事件的普通对象。

3、使用纯函数来执行修改,为了描述action如何改变state tree,需要编写reducer。

Redux数据流的管理:

1、action:把数据传递到Store,唯一数据来源。

2、reducer:action只描述有事情发生,reducer指明如何更新state,即设计state结构和action处理。

3、Store:把action和reducer联系到一起,负责维持、获取和更新state。

4、生命周期:数据流严格且单向

调用Store.dispatch(action)->Store调用传入的reducer函数,Store会把两个参数传入reducer:当前的state树和action->根reducer将多个子reducer输出合并成一个单一的state树->Store保存了根reducer,并返回完整的state树。