@genesis-xyz/overlay
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@genesis-xyz/overlay", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
import { AssetIO } from './AssetIO'; | ||
import { AssetRef } from './AssetRef'; | ||
import { AssetResult } from './AssetResult'; | ||
@@ -10,3 +9,3 @@ | ||
tag: AssetTag, | ||
get: <DepT>(ref: AssetRef<DepT>) => Promise<DepT> | ||
get: <DepT>(asset: Asset<DepT>, tag: AssetTag) => Promise<DepT> | ||
) => Promise<AssetResult<T>>; | ||
@@ -13,0 +12,0 @@ |
@@ -12,3 +12,7 @@ export type AssetResult<T> = | ||
// A class all AssetResults extend, which can be used for runtime type checking via instanceof | ||
export class BaseAssetResult {} | ||
export class BaseAssetResult { | ||
// NOTE: This private property is here so that an AssetFn is only correct if it returns a type extending BaseAssetResult... | ||
// Without it, returning any type is considered valid. | ||
private _type = 'AssetResult' as const; | ||
} | ||
@@ -15,0 +19,0 @@ /** The asset was resolved successfully */ |
@@ -7,3 +7,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { AssetResolver } from './AssetResolver'; | ||
import { AssetResultRejected, AssetResultResolved } from './AssetResult'; | ||
import { AssetResultResolved } from './AssetResult'; | ||
@@ -44,3 +44,3 @@ // Create a storage object for the assets | ||
console.log('AssetB', tagNum); | ||
const a = await get({ asset: AssetA, tag }); | ||
const a = await get(AssetA, tag); | ||
return new AssetResultResolved(tagNum + a); | ||
@@ -56,4 +56,4 @@ }, | ||
console.log('AssetC', tagNum); | ||
const a = await get({ asset: AssetA, tag }); | ||
const b = await get({ asset: AssetB, tag }); | ||
const a = await get(AssetA, tag); | ||
const b = await get(AssetB, tag); | ||
if (Math.random() > 0.5) { | ||
@@ -72,4 +72,4 @@ throw new Error('NO NO'); | ||
console.log('AssetD', tagNum); | ||
const b = await get({ asset: AssetB, tag }); | ||
const c = await get({ asset: AssetC, tag }); | ||
const b = await get(AssetB, tag); | ||
const c = await get(AssetC, tag); | ||
return new AssetResultResolved(tagNum + b + c); | ||
@@ -76,0 +76,0 @@ }, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
118610
541
1