antvis / antvis/expr

feat: support async context

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
26
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Handling Promise Contexts

```typescript
// Promises in context will be automatically resolved
const result = await evaluate('x + y', {
x: Promise.resolve(5),
y: Promise.resolve(10)
}); // returns 15

// Handling promises returned by async functions
register('fetchData', async () => {
const response = await fetch('https://api.example.com/data');
return response.json();
});

const data = await evaluate('@fetchData()');
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.