postpone icon indicating copy to clipboard operation
postpone copied to clipboard

How can I use it?

Open macx opened this issue 12 years ago • 3 comments

The test.html includes a missing build.js, the index.js throws the error module not found.

macx avatar Feb 27 '14 21:02 macx

@macx,

Thanks for taking the time to check out postpone!

Postpone is built as a Common JS (CJS) module and as a result is meant to be used in a CJS environment, e.g. required by a module you write and then compiled with some tool like Browserify or built with Component. Currently, you cannot directly use postpone in the browser, though I am getting the feeling that it should be enhanced to allow for that.

The test.html file is looking for a build.js file, which would be generated by a tool like Component. I did not include it in the repo, because I made the assumption that a user would somehow know to generate the file. I have just updated the repo to include this file so you can test postpone without installing Component.

What kind of project are you working on? How would you ideally like to use postpone?

Thanks, Lucas

lsvx avatar Feb 27 '14 22:02 lsvx

@lsvx I'm working on a fluid photo gallery with photos from a Google+ gallery (using the still existing Picasa API) for macx.de. At the moment I'm playing around with the technical possibilities to load the images sources if will become visible in the viewport (on demand). The native postpone and your polyfill could do the job, I think.

macx avatar Feb 28 '14 10:02 macx

@macx,

I just published an update to postpone that makes it compatible with non-CJS-style environments. You can now use postpone as a browser global or in conjunction with AMD loaders. I think this should make postpone much more accessible and easy to get started with.

Please note that if you are using postpone in a large project or as a dependency for a library you would like to distribute publicly, then it is advisable to import it as a module rather than use it as a global variable to avoid polluting the global namespace.

@macx, please try the new release of postpone and let me know if you can get it working. If everything works to your liking, we can close this issue.

Thanks, Lucas

lsvx avatar Feb 28 '14 18:02 lsvx