This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| componentWillMount() { | |
| this.props.requestPhotos(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { takeLatest } from 'redux-saga'; | |
| import { PHOTOS_REQUEST } from 'actions/photos'; | |
| function* requestPhotos() { | |
| // ... | |
| } | |
| export function* watchRequestPhotos() { | |
| yield* takeLatest(PHOTOS_REQUEST, requestPhotos); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function requestContextData(store = {}, { components = [] }) { | |
| const promises = components.reduce((prev, current = {}) => { | |
| return (current.need || []).concat(prev); | |
| }, []).map((need) => store.dispatch(need())); | |
| return Promise.all(promises); | |
| } | |
| // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { requestPosts } from 'actions/posts'; | |
| // .. | |
| static need = [ | |
| () => requestPosts() | |
| ] | |
| componentDidMount() { | |
| if (!this.props.posts) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .broken{background-size:100%;background-image:-webkit-gradient(linear,0 50%,100% 50%,color-stop(0%,#000),color-stop(100%,#fff));background-image:-webkit-linear-gradient(left,#000,#fff);background-image:-moz-linear-gradient(left,#000,#fff);background-image:-o-linear-gradient(left,#000,#fff);background-image:linear-gradient(left,#000,#fff)} | |
| .working{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iNTAlIiB4Mj0iMTAwJSIgeTI9IjUwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background:-webkit-gradient(linear,0 50%,100% 50%,color-stop(0%,#000),color-stop(100%,#fff));background:-webkit-linear-gradient(left,#0 |