-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: join relatedCommercedata with editorial data
- Loading branch information
Showing
23 changed files
with
982 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
46 changes: 46 additions & 0 deletions
46
packages/redux/src/products/actions/factories/fetchCustomListingFactory.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import fetchProductListFactory from './fetchProductListFactory.js'; | ||
import type { | ||
Config, | ||
GetProductListing, | ||
GetProductListingQuery, | ||
ProductListing, | ||
} from '@farfetch/blackout-client'; | ||
import type { Dispatch } from 'redux'; | ||
import type { GetOptionsArgument, StoreState } from '../../../types/index.js'; | ||
import type { ProductListActionOptions } from '../../types/index.js'; | ||
|
||
/** | ||
* Creates a thunk factory configured with the specified client to fetch a specific | ||
* custom listing page by its id. | ||
* | ||
* @param getProductSet - Get custom listing page produts client. | ||
* | ||
* @returns Thunk factory. | ||
*/ | ||
const fetchCustomListingFactory = | ||
(getListing: GetProductListing) => | ||
( | ||
slug: string | number, | ||
query: GetProductListingQuery = {}, | ||
actionOptions?: ProductListActionOptions, | ||
config?: Config, | ||
) => | ||
( | ||
dispatch: Dispatch, | ||
getState: () => StoreState, | ||
options: GetOptionsArgument, | ||
): Promise<ProductListing | undefined> => | ||
fetchProductListFactory( | ||
getListing, | ||
slug, | ||
query, | ||
actionOptions, | ||
config, | ||
dispatch, | ||
getState, | ||
options, | ||
false, | ||
true, | ||
) as Promise<ProductListing | undefined>; | ||
|
||
export default fetchCustomListingFactory; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { fetchCustomListingFactory } from './factories/index.js'; | ||
import { getProductListing } from '@farfetch/blackout-client'; | ||
|
||
/** | ||
* Fetch a specific custom listing by its id. | ||
*/ | ||
export default fetchCustomListingFactory(getProductListing); |
This file contains 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
Oops, something went wrong.