Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
This repository was archived by the owner on Aug 14, 2025. It is now read-only.

cache overflow and ready prop features #6

@krukid

Description

@krukid

Hi, the component looks nice, unfortunately I cannot use it as is for my use case, which is:

SPA that shows pages of images, preloading the next page until the user forces it to show.

This can be supported by adding two features:

  1. Pass a ready prop that would override internal state and show the children, which would allow an external event like user interaction to affect things regardless of preload status.
  2. Specify max cache size that would ensure older images get dropped from the cache.

I can work around the "ready prop" by doing something like:

render() {
  const {ready, children, ...other} = this.props
  return (
    {ready ? <Preload {...other}>{children}</Preload> : {children}}
  )
}

But seems that encapsulating this may be cleaner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions