repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 2.37 kB
JSON
{"ast":null,"code":"import { useEffect, useState } from 'react';\nimport { Asset } from \"./Asset\";\nexport function useAssets(moduleIds) {\n const [assets, setAssets] = useState();\n const [error, setError] = useState();\n useEffect(() => {\n Asset.loadAsync(moduleIds).then(setAssets).catch(setError);\n }, []);\n return [assets, error];\n}","map":{"version":3,"names":["useEffect","useState","Asset","useAssets","moduleIds","assets","setAssets","error","setError","loadAsync","then","catch"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/expo-asset/src/AssetHooks.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { Asset } from './Asset';\n\n// @needsAudit\n/**\n * Downloads and stores one or more assets locally.\n * After the assets are loaded, this hook returns a list of asset instances.\n * If something went wrong when loading the assets, an error is returned.\n *\n * > Note, the assets are not \"reloaded\" when you dynamically change the asset list.\n *\n * @return Returns an array containing:\n * - on the first position, a list of all loaded assets. If they aren't loaded yet, this value is\n * `undefined`.\n * - on the second position, an error which encountered when loading the assets. If there was no\n * error, this value is `undefined`.\n *\n * @example\n * ```tsx\n * const [assets, error] = useAssets([require('path/to/asset.jpg'), require('path/to/other.png')]);\n *\n * return assets ? <Image source={assets[0]} /> : null;\n * ```\n */\nexport function useAssets(moduleIds: number | number[]): [Asset[] | undefined, Error | undefined] {\n const [assets, setAssets] = useState<Asset[]>();\n const [error, setError] = useState<Error>();\n\n useEffect(() => {\n Asset.loadAsync(moduleIds).then(setAssets).catch(setError);\n }, []);\n\n return [assets, error];\n}\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SAASC,KAAK;AAuBd,OAAM,SAAUC,SAASA,CAACC,SAA4B;EACpD,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGL,QAAQ,EAAW;EAC/C,MAAM,CAACM,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,EAAS;EAE3CD,SAAS,CAAC,MAAK;IACbE,KAAK,CAACO,SAAS,CAACL,SAAS,CAAC,CAACM,IAAI,CAACJ,SAAS,CAAC,CAACK,KAAK,CAACH,QAAQ,CAAC;EAC5D,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,CAACH,MAAM,EAAEE,KAAK,CAAC;AACxB","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}