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

Villain v2.0.0 #634

Open
12 of 16 tasks
btzr-io opened this issue Aug 18, 2020 · 2 comments
Open
12 of 16 tasks

Villain v2.0.0 #634

btzr-io opened this issue Aug 18, 2020 · 2 comments
Labels
feature help wanted important Requires inmediate attention
Milestone

Comments

@btzr-io
Copy link
Owner

btzr-io commented Aug 18, 2020

Tracking progress for next version:

If you have more ideas or features that you will like to see for the next version leave a comment below.

@btzr-io btzr-io added help wanted important Requires inmediate attention feature labels Aug 18, 2020
@btzr-io
Copy link
Owner Author

btzr-io commented Sep 3, 2020

Quick draft for the new API (based on hooks and events )

const eventHandlers = {
  OnLoading: () => { /* do something */ }
}

<Villain src={'my_archive.cbz'} options={...} events={EventHandlers}>
  <MyCustomImageRender />
  // Or use default UI
 <VillainUI options={ theme: 'dark', ...more } />
</Villain>

@btzr-io
Copy link
Owner Author

btzr-io commented Sep 3, 2020

Also added a better way for tracking the progress from loading the archive to extraction of images.
based on the HtmlMediaElement.readystate property. It can be used instead of custom listener for events.

This should be added to the docs as well:

export const READY_STATE = {
  // There is no archive or source to load
  NOTHING: 0,
  // Fetching archive from the web
  LOADING_ARCHIVE: 1,
  // Find all data to unpack
  READING_ARCHIVE: 2,
  // Unpack images and create pages
  UNPACKING_ARCHIVE: 3,
  // All pages where created
  READY: 4,
  // An error ocurred, the `error` property on the global store will contain more info
  ERROR: 5,
}

@btzr-io btzr-io added this to the v2.0.0 milestone Sep 3, 2020
@btzr-io btzr-io pinned this issue Sep 3, 2020
@btzr-io btzr-io mentioned this issue Aug 2, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature help wanted important Requires inmediate attention
Projects
None yet
Development

No branches or pull requests

1 participant