How to use the expo-asset.Asset.fromMetadata function in expo-asset

To help you get started, we’ve selected a few expo-asset examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / expo-asset_v4.x.x / flow_v0.104.x- / test_expo-asset.js View on Github external
it('should raise an error when call with invalid argument', () => {
      // $ExpectError: first argument must be an object
      Asset.fromMetadata(true);
      // $ExpectError: missing required props
      Asset.fromMetadata({});
    });
  });
github flow-typed / flow-typed / definitions / npm / expo-asset_v4.x.x / flow_v0.104.x- / test_expo-asset.js View on Github external
it('should raise an error when call with invalid argument', () => {
      // $ExpectError: first argument must be an object
      Asset.fromMetadata(true);
      // $ExpectError: missing required props
      Asset.fromMetadata({});
    });
  });
github flow-typed / flow-typed / definitions / npm / expo-asset_v4.x.x / flow_v0.104.x- / test_expo-asset.js View on Github external
it('should passes when used properly', () => {
      const requiredMeta = {
        hash: 'str',
        name: 'str',
        type: 'str',
        scales: [1, 2],
        httpServerLocation: 'str',
      };
      Asset.fromMetadata(requiredMeta).downloadAsync();

      Asset.fromMetadata({
        width: 1,
        height: 1,
        uri: 'str',
        fileHashes: ['str'],
        fileUris: ['str'],
        ...requiredMeta,
      }).downloadAsync();

      Asset.fromMetadata({
        width: undefined,
        height: undefined,
        uri: undefined,
        fileHashes: undefined,
        fileUris: undefined,
        ...requiredMeta,
      }).downloadAsync();
github flow-typed / flow-typed / definitions / npm / expo-asset_v4.x.x / flow_v0.104.x- / test_expo-asset.js View on Github external
it('should passes when used properly', () => {
      const requiredMeta = {
        hash: 'str',
        name: 'str',
        type: 'str',
        scales: [1, 2],
        httpServerLocation: 'str',
      };
      Asset.fromMetadata(requiredMeta).downloadAsync();

      Asset.fromMetadata({
        width: 1,
        height: 1,
        uri: 'str',
        fileHashes: ['str'],
        fileUris: ['str'],
        ...requiredMeta,
      }).downloadAsync();

      Asset.fromMetadata({
        width: undefined,
        height: undefined,
        uri: undefined,
        fileHashes: undefined,
        fileUris: undefined,

expo-asset

An Expo universal module to download assets and pass them into other APIs

MIT
Latest version published 17 days ago

Package Health Score

83 / 100
Full package analysis