Reputation: 1637
I have created many snippets in the Chrome devtool's "Elements > Snippets" panel.
I have a snippet with utility functions like loadJquery
, loadUnderscore
, etc. I would like to call these functions from another snippet. Is this possible?
Upvotes: 4
Views: 2229
Reputation: 1846
Came here cause I struggle with the same question.
I think the correct answer would be yes, if you run each one of them individually and in dependency order.
For example, I have a snippet with a pickDeep()
functionality that I got from here. And then I created some other snippets which use that function. So what I do is just run the one with the pickDeep()
declaration first, and then run any other snippet which use it.
It's the exact same thing as if you had typed and run everything on the console directly. So it does not matter where the declaration comes from, as long as it has been declared some way in the current session.
Of course is not the desirable way, but I want to point out there is a workaround.
Upvotes: 6
Reputation: 10981
No, snippets have no knowledge of other snippets nor is there a way to query them up. Snippets are isolated scripts that work independently of each other.
Upvotes: 5