Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Triggers #156

Open
Yay295 opened this issue Jan 1, 2025 · 1 comment
Open

Custom Triggers #156

Yay295 opened this issue Jan 1, 2025 · 1 comment

Comments

@Yay295
Copy link

Yay295 commented Jan 1, 2025

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;
    }
});
@Yay295
Copy link
Author

Yay295 commented Feb 21, 2025

I hadn't looked at it until now, but in-app custom triggers is basically https://developers.reddit.com/docs/capabilities/realtime, except without the need for it to be real-time, and available everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant