Comments (8)
It's certainly compatible with ES6 style imports.
import {pleaseWait} from "please-wait"
from please-wait.
I did manage to figure that out after digging into the source, but would it be possible to make that function the default export?
And would it be possible to add this to the documentation somewhere? Along with the path for the extra css files that need to be imported when you install via NPM?
from please-wait.
We can certainly document it. As for the default import, my personal opinion is that it doesn't add a whole lot of usability while still adding complexity. Since we can't deprecate the old, but still ES6 compatible way to import the function, why have two? Default exports as well as replacing the whole exports
object with something else like the pleaseWait
function should have never been a thing, but, alas, I don't make the rules.
from please-wait.
I'm having an issue with this as well... I'm new to webpack so it may be a problem with my configuration. But I have imported pleaseWait as described above import {pleaseWait} from 'please-wait';
and still get Uncaught ReferenceError: pleaseWait is not defined
from please-wait.
Here's the way I wound up getting it to work:
import pw from 'please-wait';
pw.pleaseWait({
logo: 'someurl'
// etc
});
from please-wait.
@dzackgarza I really don't understand how it could work like that. Are you using Babel? The PleaseWait module just adds a pleaseWait
property on the exports
object - I can't see how that would end up as the default.
from please-wait.
I ended up using the CSS but not the javascript. PITA.
from please-wait.
@guncha Yep, that was in a webpack setup with babel-loader and babel-polyfill. I don't profess to know how or why it works, but it did seem to do the trick!
Some relevant parts of the config:
const config = {
...
entry: {
dashboard: ['babel-polyfill', './frontend/dashboard.js']
},
...
module: {
loaders: [
...
{
test: /\.js$/,
use: 'babel-loader'
},
]
}
};
Some of the babel -related packages used:
"babel-cli": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-minify-webpack-plugin": "^0.2.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
from please-wait.
Related Issues (20)
- Loading Page Loaded After Some Elements HOT 2
- Disable logo HOT 3
- I'm having trouble installing it HOT 1
- Callback HOT 2
- Adjust speed of animation HOT 2
- updateLoadingHtml isn't working HOT 3
- Is there anyway ton include this loading screen in a <div> for example ? HOT 2
- How to transparent background HOT 2
- Percentage HOT 1
- Not working well on safari ? HOT 1
- Good script but no maintenance release? HOT 1
- Update documentation HOT 2
- This plugin is not good HOT 2
- Web page jumping after preloader finished HOT 1
- window.pleaseWait is not a function HOT 1
- Can you please share source code of demo
- Please do an Angular 6+ version HOT 1
- Makes your application appear slow HOT 1
- Issue from updateLoadingHtml()
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 please-wait.