ResolveCallers

@twine-protocol/twine-core v0.1.0Docs


twine-js / @twine-protocol/twine-core / ResolveCallers

Type Alias: ResolveCallers

ResolveCallers: object

An object containing methods to fetch twines

Used by the resolveHelper function

These methods may return null or throw an error if the twine is not found and the resolveHelper function will handle that.

These methods do not need to check the signature of the twine or anything, that is all handled by the resolveHelper function.

Type declaration

Name
Type
Description
Defined in

fetchChain

(q, options) => Awaitable<Chain | null>

Fetch a chain

fetchPulse

(q, options) => Awaitable<Pulse | null>

Fetch a pulse

cache?

TwineCache | false | null

A cache to use If set to false or null, no caching will be done Normally a resolver will keep a reference to its cache and simply pass it through in here. Example resolveHelper({ //... cache: this.cache })

requestCache?

Map<string, Promise<Chain | Pulse>>

A cache to use for requests If set to false or null, no caching will be done This is a cache of pending requests, so that a lookup for the same twine is not made multiple times. It is sufficient to use a simple Map for this. Example //... resolveHelper({ //... requestCache: this.requestCache // a Map() })

Defined in

packages/twine-core/src/resolver/helpers.ts:95

Last updated