{"action":"opened","issue":{"url":"https://api.github.com/repos/mcuking/js-blog/issues/32","repository_url":"https://api.github.com/repos/mcuking/js-blog","labels_url":"https://api.github.com/repos/mcuking/js-blog/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/mcuking/js-blog/issues/32/comments","events_url":"https://api.github.com/repos/mcuking/js-blog/issues/32/events","html_url":"https://github.com/mcuking/js-blog/issues/32","id":302067908,"number":32,"title":"reselector","user":{"login":"mcuking","id":22924912,"avatar_url":"https://avatars2.githubusercontent.com/u/22924912?v=4","gravatar_id":"","url":"https://api.github.com/users/mcuking","html_url":"https://github.com/mcuking","followers_url":"https://api.github.com/users/mcuking/followers","following_url":"https://api.github.com/users/mcuking/following{/other_user}","gists_url":"https://api.github.com/users/mcuking/gists{/gist_id}","starred_url":"https://api.github.com/users/mcuking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcuking/subscriptions","organizations_url":"https://api.github.com/users/mcuking/orgs","repos_url":"https://api.github.com/users/mcuking/repos","events_url":"https://api.github.com/users/mcuking/events{/privacy}","received_events_url":"https://api.github.com/users/mcuking/received_events","type":"User","site_admin":false},"labels":[{"id":828185430,"url":"https://api.github.com/repos/mcuking/js-blog/labels/react","name":"react","color":"50dd4b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-04T08:35:01Z","updated_at":"2018-03-04T08:35:01Z","closed_at":null,"author_association":"OWNER","body":"mapStateToProps也被叫做selector，在store发生变化的时候就会被调用，而不管是不是selector关心的数据发生改变它都会被调用，所以如果selector计算量非常大，每次更新都重新计算可能会带来性能问题。Reselect能帮你省去这些没必要的重新计算。\r\nReselect 提供 createSelector 函数来创建可记忆的 selector。createSelector 接收一个 input-selectors 数组和一个转换函数作为参数。如果 state tree 的改变会引起 input-selector 值变化，那么 selector 会调用转换函数，传入 input-selectors 作为参数，并返回结果。如果 input-selectors 的值和前一次的一样，它将会直接返回前一次计算的数据，而不会再调用一次转换函数。这样就可以避免不必要的计算，为性能带来提升。"}}
{"actor":{"display_login":"mcuking"}}