Effection Logo
@effection-contrib/deno-deployv0.1.0thefrontside/effection-contrib
JSR BadgeNPM Badge with published versionBundle size badgeDependency count badgeTree shaking support badge
import { } from "@effection-contrib/deno-deploy"

Deno Deploy

Provides Deno Deploy Effection context with region, deploymentId and isDenoDeploy flag to detect when running in the Deno Deploy environment. This can be useful when testing an application that's deployed to Deno Deploy.

API Reference

interface DenoDeploy

Properties

isDenoDeploy: boolean

True when running in Deno Deploy

deploymentId: string | undefined

ID of the current Deno Deploy environment

region: string | undefined

It holds the region code of the region in which the deployment is running. You can use this variable to serve region-specific content. You can refer to the region code from the regions page.

const DenoDeployContext: Context<DenoDeploy>

Context used to access DenoDeploy value

function*() {
 const {
   isDenoDeploy,
   deploymentId,
   region
 } = yield* DenoDeployContext;
}

Type

Context<DenoDeploy>

function* initDenoDeploy(): Operation<DenoDeploy>

Use at the root of your application to setup Deno Deploy context.

import { main } from "effection";
import { initDenoDeploy } from "@effection-contrib/deno-deploy";

await main(function*() {
 yield* initDenoDeploy();
});

Return Type

Operation<DenoDeploy>

function* useDenoDeploy(): Operation<DenoDeploy>

Use to read the values of Deno Deploy Context.

import { useDenoDeploy } from "@effection-contrib/deno-deploy";

function* () {
 const { isDenoDeploy } = yield* useDenoDeploy();
}

Return Type

Operation<DenoDeploy>