alloc / alloc/saus

Investigate whether memory usage can be reduced by not caching Promise objects

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
TypeScript
Stars
38
Forks
1
PR merge metrics
No merged PRs in 30d

Description

image

My strategy would be to wrap cached promises with a new `CachedPromise` class.

```ts
class CachedPromise {
constructor(promise) {
this.promise = promise
promise.then((result) => {
this.result = result
this.promise = null
}, (error) => {
this.error = error
this.promise = null
})
}
then() {}
catch() {}
finally() {}
}
```

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.