Skip to content

Loading hooks services in sandboxed scripts

Compare
Choose a tag to compare
@Pierre-Gilles Pierre-Gilles released this 09 Nov 15:00
· 2486 commits to master since this release

Hooks services are now loaded in scripts ! It means that you can use in your scripts your favorites module's services :)

Important

Introducing gladys global variable.

Gladys is an event emitter, replacing sails.config.Event, now deprecated ( but still included )

If you want to test when Gladys is ready, you now have to do :

gladys.on('sailsReady', function(){

});

Be careful, many people still have old Gladys, so in your modules, 3 possibilities :

  • Keep old sails.config.Event
  • Test if gladys variable exist, if not give it sails.config.Event value
  • Ask people in your installation guide to update Gladys to version >= 2.1.4 before installing your module