Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

life-cycle: resource status change listener #102

Open
myfreeer opened this issue Nov 25, 2020 · 0 comments
Open

life-cycle: resource status change listener #102

myfreeer opened this issue Nov 25, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@myfreeer
Copy link
Member

myfreeer commented Nov 25, 2020

This would enable invokers to save the status, to file or database. Another issue should be fired to enable resources being loaded to a downloader.

Resource status should contain:

  • createResource
  • processBeforeDownload
  • download
  • processAfterDownload
  • saveToDisk
  • error
  • dispose

The dispose status invoked if a resource passed all the life cycles, or interrupted by a void return of a life-cycle function, or a shouldBeDiscardedFromDownload prop.

A status change listener should be invoked concurrently, ignoring thrown errors. Invokers should decide whether to return a promise or not. A status change listener should conider the resource or any else parameter passed to it readonly, and the behavior of changing it considered UB.

We might use add EventEmitter to pipeline or downloader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant