Hi BJ,

Thanks very much for the help. Can you possibly explain this in more depth? 
I've tried to follow your instructions, and also read up on hooks from 
twdocs and looked at the code in `boot.js`, but I still don't fully 
understand how a hook function is called.

The following is my progress so far.

I wasn't sure where exactly the addHook function belonged or what the name 
was supposed to be. My best guess was that they belonged in the plugin 
startup module itself. So I took the main function in 
`create-pinboard-tiddlers.js` and moved it to a new one.
I tested two different formats of `addhook()` based on what I read:

exports.startup = function() {

    // $tw.hooks.addHook("reset-pinboard-tiddlers",function() { 
    //     runPinboardPlugin();
    //     return; 
    // });

    $tw.hooks.addHook("th-saving-tiddler",function(tiddler) { 
        runPinboardPlugin();
        return tiddler; 
    });

    runPinboardPlugin();
}

As you can see I commented out the first one, but I did try both. In both 
cases, the plugin worked normally on startup. In neither case was I able to 
successfully `invokeHook()`. I tried Chrome dev-tools snippets:

`$tw.hooks.invokeHook("th-saving-tiddler");`

&

``$tw.hooks.invokeHook("reset-pinboard-tiddlers");`

depending on which one I was trying, but neither did anything. I also tried 
saving tiddlers for the "th-saving-tiddler" test but this did nothing 
either.

What am I doing wrong?

All the best,
Matt

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/27dca371-e687-4646-b442-a31e42007478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to