ILoader Interface
The Runtime's view of the Loader, used for loading Containers
To use, import via @fluidframework/container-definitions/legacy.
For more information about our API support guarantees, see here.
Signature
export interface ILoader extends Partial<IProvideLoader>
Extends: Partial<IProvideLoader>
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| resolve(request, pendingLocalState) | Beta | Promise<IContainer> | Resolves the resource specified by the URL + headers contained in the request object to the underlying container that will resolve the request. |
Method Details
resolve
Resolves the resource specified by the URL + headers contained in the request object to the underlying container that will resolve the request.
For more information about our API support guarantees, see here.
Signature
resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
Remarks
An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes a request against the server found from the resolve step.
When pendingLocalState is provided, the resolved container is rehydrated from a blob previously produced by getPendingLocalState().
WARNING: misuse of pendingLocalState can result in duplicate op submission and potential document corruption. To prevent container forking, callers must:
- Pass the most recent blob produced for that container and discard any older serializations. - Ensure the original container has been closed before rehydrating from its serialized state. - Never rehydrate more than one container from the same blob.
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| request | IRequest | ||
| pendingLocalState | optional | string |
Returns
Return type: Promise<IContainer>