Can skuid.snippet.registerSnippet() handle multiple snippets?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
And would the syntax be as follows?

skuid.snippet.registerSnippet({
   'snippetName1' : function (),
   'snippetName2' : function ()
})
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
No, but it's a good idea. You could implement this yourself with a little code:

var snippets = {
   'snippetName1': function() { ... },
   'snippetName2': function() { ... }
};

skuid.$.each(snippets,function(name,func){ skuid.snippet.registerSnippet(name,func); });
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
nice!