Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader: Pull in stores that accept actions when pre-loading. #569

Merged
merged 1 commit into from
Nov 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions client/lib/reader-feed-subscriptions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ var FeedSubscriptionActions = {
callback = inflight.requestTracker( requestKey, function( error, data ) {
FeedSubscriptionStore.setIsFetching( false );
FeedSubscriptionActions.receiveFollowingList( error, data );
cb && cb( error, data );
if ( cb ) {
cb( error, data );
}
} );

FeedSubscriptionStore.setIsFetching( true );
Expand All @@ -131,12 +133,13 @@ var FeedSubscriptionActions = {

/**
* Fetch next page of followed feeds via the REST API
*/
*
* @param cb callback to invoke when complete
**/
fetchNextPage: function( cb ) {
var params;

if ( FeedSubscriptionStore.isLastPage() ) {
onComplete();
return;
}

Expand Down
4 changes: 4 additions & 0 deletions client/reader/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ function pageTitleSetter() {

module.exports = {
loadSubscriptions: function( context, next ) {
// these three are included to ensure that the stores required have been loaded and can accept actions
const FeedSubscriptionStore = require( 'lib/reader-feed-subscriptions' ), // eslint-disable-line no-unused-vars
PostEmailSubscriptionStore = require( 'lib/reader-post-email-subscriptions' ), // eslint-disable-line no-unused-vars
CommentEmailSubscriptionStore = require( 'lib/reader-comment-email-subscriptions' ); // eslint-disable-line no-unused-vars
FeedSubscriptionActions.fetchAll();
next();
},
Expand Down