Documentation / @etherfold/browser / loadProcessorBundle
Function: loadProcessorBundle() ​
loadProcessorBundle<
EntityProcessorType>(location,options?):Promise<ProcessorBundleOutcome<EntityProcessorType>>
Defined in: packages/browser/src/processorBundle.ts:188
FETCH A PUBLISHED BUNDLE, NAME IT BY ITS BYTES, AND INSTANTIATE IT FROM THEM.
The order is loadProcessorArtifact's and for its reason: everything checkable happens BEFORE evaluation, which is the irreversible act (the module joins this context's registry for its lifetime and its top-level code runs). So a bundle that still imports something is refused against its bytes and never evaluated.
const bundle = await loadProcessorBundle<EntityProcessor<MyAbi>>('/processor.bundle.js');
if (bundle.status === 'refused') return render(bundle.why);
// bundle.identity is the generation's processor identity, and nothing parses it.The factory is called with NO arguments, as the CLI calls it: a processor's own configuration is applied by the host through configure (processorConfig).
Type Parameters ​
EntityProcessorType ​
EntityProcessorType = unknown
Parameters ​
location ​
options? ​
Returns ​
Promise<ProcessorBundleOutcome<EntityProcessorType>>