the-forest/client/node_modules/.cache/babel-loader/84c5b8b2c2364d15342d2e81366ab19ca72e22235edae4ba36e7c05dbb741061.json
2024-09-17 20:35:18 -04:00

1 line
22 KiB
JSON

{"ast":null,"code":"// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter(x => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({\n type: \"failed\",\n failureCount,\n error\n });\n },\n onPause: () => {\n this.#dispatch({\n type: \"pause\"\n });\n },\n onContinue: () => {\n this.#dispatch({\n type: \"continue\"\n });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (!restored) {\n this.#dispatch({\n type: \"pending\",\n variables,\n isPaused\n });\n await this.#mutationCache.config.onMutate?.(variables, this);\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this);\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this);\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({\n type: \"success\",\n data\n });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(error, variables, this.state.context, this);\n await this.options.onError?.(error, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this);\n await this.options.onSettled?.(void 0, error, variables, this.state.context);\n throw error;\n } finally {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = state => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach(observer => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport { Mutation, getDefaultState };","map":{"version":3,"names":["notifyManager","Removable","createRetryer","Mutation","observers","mutationCache","retryer","constructor","config","mutationId","state","getDefaultState","setOptions","options","scheduleGc","updateGcTime","gcTime","meta","addObserver","observer","includes","push","clearGcTimeout","notify","type","mutation","removeObserver","filter","x","optionalRemove","length","status","remove","continue","execute","variables","fn","mutationFn","Promise","reject","Error","onFail","failureCount","error","dispatch","onPause","onContinue","retry","retryDelay","networkMode","canRun","restored","isPaused","canStart","onMutate","context","data","start","onSuccess","onSettled","onError","runNext","#dispatch","action","reducer","failureReason","submittedAt","Date","now","batch","forEach","onMutationUpdate"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@tanstack/query-core/src/mutation.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface MutationConfig<TData, TError, TVariables, TContext> {\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions<TData, TError, TVariables, TContext>\n state?: MutationState<TData, TError, TVariables, TContext>\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> {\n context: TContext | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction<TError> {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction<TVariables, TContext> {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TContext\n}\n\ninterface SuccessAction<TData> {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction<TError> {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action<TData, TError, TVariables, TContext> =\n | ContinueAction\n | ErrorAction<TError>\n | FailedAction<TError>\n | PendingAction<TVariables, TContext>\n | PauseAction\n | SuccessAction<TData>\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TContext = unknown,\n> extends Removable {\n state: MutationState<TData, TError, TVariables, TContext>\n options!: MutationOptions<TData, TError, TVariables, TContext>\n readonly mutationId: number\n\n #observers: Array<MutationObserver<TData, TError, TVariables, TContext>>\n #mutationCache: MutationCache\n #retryer?: Retryer<TData>\n\n constructor(config: MutationConfig<TData, TError, TVariables, TContext>) {\n super()\n\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions<TData, TError, TVariables, TContext>,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver<any, any, any, any>): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver<any, any, any, any>): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise<unknown> {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise<TData> {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n return this.options.mutationFn(variables)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (!restored) {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n await this.#mutationCache.config.onMutate?.(\n variables,\n this as Mutation<unknown, unknown, unknown, unknown>,\n )\n const context = await this.options.onMutate?.(variables)\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n )\n\n await this.options.onSuccess?.(data, variables, this.state.context!)\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n )\n\n await this.options.onSettled?.(data, null, variables, this.state.context)\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n )\n\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n )\n\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n )\n throw error\n } finally {\n this.#dispatch({ type: 'error', error: error as TError })\n }\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action<TData, TError, TVariables, TContext>): void {\n const reducer = (\n state: MutationState<TData, TError, TVariables, TContext>,\n ): MutationState<TData, TError, TVariables, TContext> => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TContext,\n>(): MutationState<TData, TError, TVariables, TContext> {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n"],"mappings":";AAAA,SAASA,aAAA,QAAqB;AAC9B,SAASC,SAAA,QAAiB;AAC1B,SAASC,aAAA,QAAqB;AA8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