April 11, 2024, 10:03 p.m. | naugtur

DEV Community dev.to

How can I have one implementation of some complex logic that can call out to sync or async hooks where the async one needs to be properly awaited each time?


I told ChatGPT to teach me that. Below is our (heavily/extensively/drastically/substantially/profoundly redacted and fixed) chat log.



in javascript, I have a function that's accepting a hook as input, runs a few synchronous operations, calls the hook and runs a few synchronous operations on the results. You can represent the operations …

async asynchronous call chatgpt gpt hooks implementation javascript llm logic programming

Data Engineer

@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania

Artificial Intelligence – Bioinformatic Expert

@ University of Texas Medical Branch | Galveston, TX

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York