1.5.0 • Published 9 months ago

@effect-aws/client-sqs v1.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@effect-aws/client-sqs

Installation

npm install --save @effect-aws/client-sqs

Usage

With default SQSClient instance:

import { SQSService, DefaultSQSServiceLayer } from "@effect-aws/client-sqs";

const program = SQSService.sendMessage(args);

const result = pipe(
  program,
  Effect.provide(DefaultSQSServiceLayer),
  Effect.runPromise,
);

With custom SQSClient instance:

import {
  SQSService,
  BaseSQSServiceLayer,
  SQSClientInstance,
} from "@effect-aws/client-sqs";

const program = SQSService.sendMessage(args);

const SQSClientInstanceLayer = Layer.succeed(
  SQSClientInstance,
  new SQSClient({ region: "eu-central-1" }),
);

const result = await pipe(
  program,
  Effect.provide(BaseSQSServiceLayer),
  Effect.provide(SQSClientInstanceLayer),
  Effect.runPromise,
);

With custom SQSClient configuration:

import {
  SQSService,
  BaseSQSServiceLayer,
  DefaultSQSClientConfigLayer,
  SQSClientInstance,
  SQSClientInstanceConfig,
} from "@effect-aws/client-sqs";

const program = SQSService.sendMessage(args);

const SQSClientInstanceLayer = Layer.provide(
  Layer.effect(
    SQSClientInstance,
    SQSClientInstanceConfig.pipe(
      Effect.map(
        (config) => new SQSClient({ ...config, region: "eu-central-1" }),
      ),
    ),
  ),
  DefaultSQSClientConfigLayer,
);

const result = await pipe(
  program,
  Effect.provide(BaseSQSServiceLayer),
  Effect.provide(SQSClientInstanceLayer),
  Effect.runPromiseExit,
);

or map over DefaultSQSClientConfigLayer layer context and update the configuration...

1.5.0

9 months ago

1.4.0

10 months ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.2

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago