mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Normalise trailing whitespace and line endings everywhere
This commit is contained in:
@@ -47,7 +47,7 @@ class ReceiveAlbumDetails extends Action {
|
||||
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
|
||||
// They don't directly mutate state, but they can have external side-effects (such as loading data).
|
||||
|
||||
export const actionCreators = {
|
||||
export const actionCreators = {
|
||||
requestAlbumDetails: (albumId: number): ActionCreator => (dispatch, getState) => {
|
||||
// Only load if it's not already loaded (or currently being loaded)
|
||||
if (albumId !== getState().albumDetails.requestedAlbumId) {
|
||||
@@ -59,7 +59,7 @@ export const actionCreators = {
|
||||
dispatch(new ReceiveAlbumDetails(album));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
dispatch(new RequestAlbumDetails(albumId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export const actionCreators = {
|
||||
fetch('/api/albums/mostPopular')
|
||||
.then(results => results.json())
|
||||
.then(albums => dispatch(new ReceiveFeaturedAlbums(albums)));
|
||||
|
||||
|
||||
return dispatch(new RequestFeaturedAlbums());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class ReceiveGenreDetails extends Action {
|
||||
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
|
||||
// They don't directly mutate state, but they can have external side-effects (such as loading data).
|
||||
|
||||
export const actionCreators = {
|
||||
export const actionCreators = {
|
||||
requestGenreDetails: (genreId: number): ActionCreator => (dispatch, getState) => {
|
||||
// Only load if it's not already loaded (or currently being loaded)
|
||||
if (genreId !== getState().genreDetails.requestedGenreId) {
|
||||
@@ -44,10 +44,10 @@ export const actionCreators = {
|
||||
.then(albums => {
|
||||
// Only replace state if it's still the most recent request
|
||||
if (genreId === getState().genreDetails.requestedGenreId) {
|
||||
dispatch(new ReceiveGenreDetails(genreId, albums));
|
||||
dispatch(new ReceiveGenreDetails(genreId, albums));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
dispatch(new RequestGenreDetails(genreId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class ReceiveGenresList extends Action {
|
||||
// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.
|
||||
// They don't directly mutate state, but they can have external side-effects (such as loading data).
|
||||
|
||||
export const actionCreators = {
|
||||
export const actionCreators = {
|
||||
requestGenresList: (): ActionCreator => (dispatch, getState) => {
|
||||
if (!getState().genreList.isLoaded) {
|
||||
fetch('/api/genres')
|
||||
|
||||
@@ -23,5 +23,5 @@ export const reducers = {
|
||||
};
|
||||
|
||||
// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are
|
||||
// correctly typed to match your store.
|
||||
// correctly typed to match your store.
|
||||
export type ActionCreator = ActionCreatorGeneric<ApplicationState>;
|
||||
|
||||
Reference in New Issue
Block a user