Skip to content
On this page

๐Ÿ”— @bridge/fetch-definition

This module grants access to bridge.'s lightning cache database. View Source Code

import { ... } from '@bridge/fetch-definition'

โšก Functions


The fetchDefinition function is used to search the lightning cache database, which bridge. uses to dynamically store data from a user's project.

  • Signature: fetchDefinition(fileType: string, fetchDefs: string[], fetchSearch: string, fetchAll = false)
  • Returns: Promise<string[]>
const walkAnimations = await fetchDefinition(
	'animation', // The file type to get the cache data from
	['ids'], // The cache keys to be fetched
	'animation.walk', // A string to filter the results by
	false // Whether to get all defintions or just the first

// With fetchAll = false you still get an array, but it will simply only contain one string
const walkAnimation = walkAnimations[0]

Released under the GPL-3.0 License.