Comments (4)
I agree that pify
is more suited if it was only for promisifying callbacks.
If fact, I used it earlier in the project.
But I really like bluebird's non-standard API.
Take a look at createMemory
:
export const createMemory = (fs, cacheDir) => () => {
const mfs = new MemoryFileSystem();
return fs.readdirAsync(path.join(cacheDir, 'bundles'))
.catch(() => [])
.map(filename => join(
filename,
fs.readFileAsync(path.join(cacheDir, 'bundles', filename)))
)
.map(([filename, buffer]) => {
mfs.writeFileSync(`/${filename}`, buffer);
})
.then(() => ({
getBundles: getBundles.bind(null, mfs)
}));
};
Isn't it much nicer to have the ability to map over promises like that?
What do you think?
(BTW, just notice I better change the second map to each, since it only contains a side effect and it's not mapping anything)
from autodll-webpack-plugin.
Sorry.. I didn't see that carefully. I like the Bluebird.map
too. There is p-map
though. But it's better to use bluebird
than add 2 dependencies.
from autodll-webpack-plugin.
If I only count the times (or PRs) that you showed me that I didn't look carefully enough 😉
from autodll-webpack-plugin.
@asfktz Ha ha.. 2 sets of eyes better than 1
from autodll-webpack-plugin.
Related Issues (20)
- 'Is valid cache' is aways false
- How to DevExpress to DLL? HOT 3
- got error when use dynamic import
- Only updating package produces wrong broken dll-links when using chunkhashes
- AutoDLL not working in NextJS HOT 1
- webpack4中每次修改app.js时dll会重新打包 HOT 1
- I use this plugin for react-app,it wiil not inject to the html HOT 1
- TypeError: Cannot read property 'properties' of undefined HOT 1
- multiple dll packages are generated, it will cause duplicate references HOT 2
- Is it support css dll?
- ModuleNotFoundError with Webpack 4
- stats.json are too big HOT 1
- How do I set entryOnly to true to enable treeshaking?
- Plugins are not run when cache is valid
- Autodll-webpack-plugin specifying node_modules in different projects
- what is the right context for a monorepo setup?
- inject the DLL bundles into the html fail HOT 5
- add path parameter html script src can add /
- Cannot add property autodllStatsRetrieved, object is not extensible HOT 3
- how to use this plugin with create-react-app & craco ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autodll-webpack-plugin.