MCPcopy
hub / github.com/TanStack/router / functionalUpdate

Function functionalUpdate

packages/router-core/src/utils.ts:204–213  ·  view source on GitHub ↗
(
  updater: Updater<TPrevious, TResult> | NonNullableUpdater<TPrevious, TResult>,
  previous: TPrevious,
)

Source from the content-addressed store, hash-verified

202 * Accepts either a literal value or a function of the previous value.
203 */
204export function functionalUpdate<TPrevious, TResult = TPrevious>(
205 updater: Updater<TPrevious, TResult> | NonNullableUpdater<TPrevious, TResult>,
206 previous: TPrevious,
207): TResult {
208 if (isFunction(updater)) {
209 return updater(previous)
210 }
211
212 return updater
213}
214
215const hasOwn = Object.prototype.hasOwnProperty
216const isEnumerable = Object.prototype.propertyIsEnumerable

Callers 7

buildMethod · 0.90
buildWithMatchesMethod · 0.90
finalFunction · 0.90
resolvedActivePropsFunction · 0.90
resolvedInactivePropsFunction · 0.90
useLinkPropsFunction · 0.90

Calls 1

isFunctionFunction · 0.85

Tested by

no test coverage detected