Custom Triggers

Open
#156 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
typescript
Domain
api, backend

Research direction

Start by reviewing the TypeScript trigger API entry points shown in the issue: Devvit.emitCustomEvent and Devvit.addTrigger. Clarify the event contract, cross-app delivery behavior, and payload requirements with maintainers; done should mean the custom-trigger design and its expected behavior are agreed.

Written by the indexing model from the issue text.

Description

triggers

It could be useful to be able to emit custom triggers. This could allow one app to process some data and emit a trigger with that data for other apps to act on. It could also be used within the same app, but that doesn't seem as useful. I imagine it something like this:

function myFunc() {
    {process some data}

    const id: str = 'MyEventID';
    const data: any = ...;
    Devvit.emitCustomEvent(id,data);
}

Devvit.addTrigger({
    event: 'CustomEvent',
    onEvent: (event,context) => {
        if (event.id !== 'MyEventID') {
            return;
        }
        const data = event.data;
    }
});
Dominant language
TypeScript
Stars
210
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reddit/devvit

All issues in reddit/devvit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.