DrSensor / DrSensor/nusa

Snapshot and Iterate class instances

Open
#40 1 comment 0 reactions 0 assignees View on GitHub
data binding optimization
Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

- [ ] `@iterate.for` and `@iterate.for(Class/module-path)` decorator
- [ ] `iterate.for(Class/module-path, async (index, {...accessors}) => {}, [max,min]?)`
- [x] forward iteration
- [ ] backward iteration
- [ ] forward/backward iteration with specific range
- [ ] `iterate.current.index` and `iterate.current.length`
- [x] `iterate.skip`, `iterate.skip(index)`, `iterate.skip(...accessors)` to skip render upate
- [x] `iterate.stop` to stop iteration
- [ ] `await iterate.resume` and `iterate.resume()` which similar to `yield` and `.next()`
- [ ] `snapshot(Class/module-path)` return copy of databank accessor

> **Warning** function generator might not fast enough so I'm using `await iterate.resume` instead of `yield`
> (need a benchmark to prove this)
>
> Most likely await-ing is not optimal since it require `async` keyword. This make `iterate()` switch into concurrent iteration logic if it use async function although `await iterate.resume` doesn't need to be queued into microtask.
> 💡 **Alternative**: `iterate.yield` and `iterate.resume()`

> **Note** `await iterate.continue` will render update the current changes from start/continued index to awaited index

> **Note** snapshot and iterate for WASM only support module-path instead of module instance since it still unknown
> how `import ? from "module.wasm" assert {type:"wasm"}` will be executed
>
> 📚 References:
> - [WebAssembly/ES Module Integration](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration) (use instantiateStreaming)
> - [get all the declared imports of `module.wasm`](https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Module/imports) (use compileStreaming)

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.