Skip to content

Commit

Permalink
chore(mwcp): breaking change variable defaultfetchConfigCallbacks to …
Browse files Browse the repository at this point in the history
…defaultFetchConfigCallbacks
  • Loading branch information
waitingsong committed Apr 24, 2024
1 parent dd7e315 commit 64e005f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/midway-component-fetch/src/lib/fetch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ResponseData,
} from '@waiting/fetch'

import { defaultfetchConfigCallbacks } from './helper.js'
import { defaultFetchConfigCallbacks } from './helper.js'
import { Config, ConfigKey, FetchOptions } from './types.js'


Expand Down Expand Up @@ -51,7 +51,7 @@ export class FetchComponent {

const config = this.fetchConfig

await defaultfetchConfigCallbacks.beforeRequest({
await defaultFetchConfigCallbacks.beforeRequest({
id,
config,
opts,
Expand Down Expand Up @@ -95,7 +95,7 @@ export class FetchComponent {
}

if (config.enableTrace) {
await defaultfetchConfigCallbacks.afterResponse({
await defaultFetchConfigCallbacks.afterResponse({
id,
config,
opts,
Expand All @@ -113,8 +113,8 @@ export class FetchComponent {
}
const err = new Error(msg, { cause: ex })
if (config.enableTrace) {
if (typeof defaultfetchConfigCallbacks.processEx === 'function') {
return defaultfetchConfigCallbacks.processEx({
if (typeof defaultFetchConfigCallbacks.processEx === 'function') {
return defaultFetchConfigCallbacks.processEx({
id,
config: this.fetchConfig,
opts,
Expand Down
2 changes: 1 addition & 1 deletion packages/midway-component-fetch/src/lib/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export const processEx: Config['processEx'] = async (options) => {
}
}

export const defaultfetchConfigCallbacks = {
export const defaultFetchConfigCallbacks = {
beforeRequest,
afterResponse,
processEx,
Expand Down
2 changes: 1 addition & 1 deletion packages/midway-component-fetch/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export * from './types.js'
export { FetchComponent } from './fetch.component.js'
export { FetchService } from './fetch.service.js'
export {
defaultfetchConfigCallbacks,
defaultFetchConfigCallbacks,
genRequestHeaders,
} from './helper.js'

0 comments on commit 64e005f

Please sign in to comment.