bitovi / bitovi/syn

Suggestion: use a futures API rather than callbacks

Open
#78 17 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
441
Forks
254
PR merge metrics
No merged PRs in 30d

Description

So instead of writing:

```
syn.type(a, "x", function() {
syn.click(b, function() {
syn.click(c, function() {
syn.click(d)
})
})
})
```

you could write something like:

```
syn.type(a, "x").then(function() {
return syn.click(b)
}).then(function() {
return syn.click(c)
}).then(function() {
return syn.click(d)
}).done()
```

so you don't get all stuck in callback hell. I'd suggest a futures library but i don't wanna plug my stuff too much all at once ; )

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the callback-based syn.type and syn.click examples in the issue and the existing public API. Determine how a futures-style chain should behave, including completion through done(). Done means the event methods support the proposed chained usage without callback nesting and the existing behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.