Skip to main content
Version: Next

Designing an Callback

Callback? Yeah So you can direct and send an callback to the Renderer to what to do on what?

Example​

import type { Request, Response } from "express";
import { Action, Callback, DoAction } from "@neneys/ui"

export const path = "/ui/test_callback"

export async function run(req: Request, res: Response, pass: any) {
let callbac = Callback({
callbacks: [
DoAction(Action.SHOW_TOAST, `The Server Saw What You wrote ${req.body.username} and ${req.body.password}`)
]
})

res.json(callbac);
}

What it does?​

Basically the DoAction's Action.SUBMIT Performs the Action of Sending the Variables from the Client Side into the Server-Side to /ui/test_callback route and which in returns actions to Perform and that Action could be anyting from shoing a Toast to Execution of Unrestricted JavaScript.

Explanation​

We will walkthrough each of theese components on How it works and it's appropriate parameters.