Skip to content

Conversation

@veresku
Copy link

@veresku veresku commented Dec 17, 2017

No description provided.

componentDidMount = () => {
const eventsRef = firebase.database().ref('events/');

eventsRef.on('value', (snapshot) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну делать запросы прямо из компонента - так себе идея. У нас для этого саги есть

export function* fetchLimitSaga(action) {

const {startAt, limit} = action.payload
const ref = firebase.database().ref('events').orderByKey().startAt(startAt.toString()).limitToFirst(limit)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оно ведь не работает по индексу, там должен быть ключ


export default connect((state) => ({
events: eventLimitListSelector(state),
eventsTotal: eventListSelector(state).length,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

откуда у тебя total? там ведьпросто загруженные на данный момент

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants