GithubHelp home page GithubHelp logo

clear-cache's Introduction

Hi there ๐Ÿ‘‹

I'm Dimitri Dumont, a front-end developper passionate about writing clean code. I'm interested in craftsmanship, clean and well-designed code

About me

๐Ÿ’ป I'm a front-end developer freelance
๐Ÿ I am passionate about moto, specialy Harley Davidson & vintage
๐Ÿ‹๏ธโ€โ™‚๏ธ I am also passionate about musculation
๐Ÿ“š I like to learn constantly and share
๐ŸŒ Laon, France

Technologies

โ–ช Front-end : React.js | Redux | Next.js | Typescript | Javascript
โ–ช Back-end : Node.js | SQL | Typescript
โ–ช Versionning : Git
โ–ช API implementation: Stripe | Twilio | etc.
โ–ช Tests : units | integrations | end-to-end
โ–ช DDD | CQRS | TDD | Clean code | hexagonal architecture | agility
โ–ช CI/CD: Github actions | Gitlab CI/CD

๐Ÿ“– Latests blog posts

๐Ÿ”Œ Social

clear-cache's People

Contributors

dimitridumont avatar lva98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clear-cache's Issues

cache delete not blocking

Without actually testing this case fully, when looking over the code, I think it doesn't block and therefore the reload may happen too early.

Please correct me if I am wrong :-)

I think this

        caches.keys().then((names) => {
            names.forEach(async (name) => {
                await caches.delete(name)
            })
        })

       if (reloadAfterClear) window.location.reload();

should be this (or similar):

caches.keys().then(names => {
  return Promise.all(names.map(caches.delete));
}).then(() => {
  if (reloadAfterClear) window.location.reload();
});

as the forEach does not wait for the await. (Because the function you pass forEach itself is async)
So it has to be a map which returns the promises and then await them all with Promise.all

Add type declarations for TypeScript

Hi @dimitridumont

This is not a necessarily an issue, but rather a friendly request whether you could add / create @types/clear-cache.

I would like to add this repo to one of my projects that is built with TypeScript, and currently I'm seeing this message:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.