amplitude / amplitude/Amplitude-TypeScript

Ampli DestinationPlugin doesn't support undefined return value

Đang mở
#308 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
documentation
Ngôn ngữ chính
TypeScript
Star
180
Fork
68
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
29

Mô tả

Hello,

There's a discrepancy between the docs and the implementation of the Ampli Plugin.

I'm trying to write a plugin to forward data to other services and in some cases not to Amplitude, just like [this middleware from the docs](https://www.docs.developers.amplitude.com/data/ampli/middleware/#forward-data-to-other-services-but-not-amplitude).

## Expected Behavior
According to the [docs](https://www.docs.developers.amplitude.com/data/ampli/plugin/#forward-data-to-other-services-but-not-amplitude):
> if used as a destination type plugin, the expected return value is undefined

## Current Behavior

This is not the case in the code: https://github.com/amplitude/Amplitude-TypeScript/blob/main/packages/analytics-types/src/plugin.ts#L25

## Possible Solution

Update docs / change type to allow DestinationPlugins to return undefined

## Environment
- JS SDK Version: 1.6.7
- Installation Method: yarn
- Browser and Version: Brave v1.46.153

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.