/*\
title: $:/plugins/my-plugin/plugin.js
type: application/javascript
module-type: startup
An example startup plugin
\*/
(function() {
exports.startup = function startup() {
// Do stuff
}
})();
/*\
title: $:/plugins/my-plugin/plugin.js
type: application/javascript
module-type: startup
An example startup plugin
\*/
export function startup() {
// Do stuff
}
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.startup = startup;
/*\
title: $:/plugins/my-plugin/plugin.js
type: application/javascript
module-type: startup
An example startup plugin
\*/
function startup() {
// Do stuff
}
Hi Devin,
my plugin modules end up like this:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3c1d9e6a-0693-4c04-926d-527ac52dc98c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'd be sad to see them go, they give me a warm safe feeling!
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a171be6f-4b3f-4d68-a712-dda2f19126cd%40googlegroups.com.
The reason for the apparently unnecessary IFE is so that the same .js files can be require()'d by regular Node.js code.
From the Node.js docs:
Variables local to the module will be private, as though the module was wrapped in a function
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1a20b6b7-f7a3-40a0-8712-82a4c6fc86c6%40googlegroups.com.