Skip to main content

Functions

ensureEndpointIdFormat

function ensureEndpointIdFormat(id: string): string
ParameterTypeDescription
idstring-
Returns: string

parseEndpointId

function parseEndpointId(id: string): EndpointId
ParameterTypeDescription
idstring-
Returns: EndpointId

isValidUrl

function isValidUrl(url: string): any
ParameterTypeDescription
urlstring-
Returns: any

throttle

function throttle(func: T, limit: number, leading?: any): (...funcArgs: Parameters<T>) => ReturnType<T> | void
ParameterTypeDescription
funcT-
limitnumber-
leadingany-
Returns: (...funcArgs: Parameters<T>) => ReturnType<T> | void

isReact

function isReact(): any
Not really the most optimal way to detect if we’re running in React, but the idea here is that we can support multiple rendering engines (starting with React), with all their peculiarities, without having to add a dependency or creating custom integrations (e.g. custom hooks). Yes, a bit of magic to make things works out-of-the-box. Returns: any

isPlainObject

function isPlainObject(value: any): boolean
Check if a value is a plain object.
ParameterTypeDescription
valueany- The value to check.
Returns: boolean

sleep

async function sleep(ms: number): Promise<void>
Utility function to sleep for a given number of milliseconds
ParameterTypeDescription
msnumber-
Returns: Promise<void>

Types

EndpointId

type EndpointId = {
  readonly owner: string;
  readonly alias: string;
  readonly path?: string;
  readonly namespace?: EndpointNamespace;
}