hydrajs-sandbox-plugin

Hydra.js plugin to continue using the old sandbox system to manage events in new releases.

hydrajs-sandbox-plugin

Is a plugin to maintain backward compatibility with, Hydra.js, lower version than 2.8.0.

Changelog

Install with Bower

bower install hydrajs-sandbox-plugin

Install with Component

component install hydrajs-sandbox-plugin

Install with NPM

npm install hydrajs-sandbox-plugin

Insert in your html code:

<script type="text/javascript" src="hydra.js"></script
<script type="text/javascript" src="hydrajs-sandbox-plugin.js"></script>

Insert in your code:

define(['hydrajs-sandbox-plugin'], function () {
    // code here.
});

It should be used to manage global events, and this plugin is needed to maintain compatibility with previous version to 2.8.0 of Hydra when the new Bus object has been implemented.

hydrajs-sandbox-plugin extends Hydra.js library adding new methods.

Using this method your code will start listening events.

new Hydra.action().listen( ['eventType'], callback, module );

Using this method your code will trigger the specified event.

new Hydra.action().notify( { type: 'eventType', data: {} } );

Using this method you code will stop listening events.

new Hydra.action().stopListen( ['eventType'], module );

Hydra.action is a constructor that creates the sandbox to manage events and it should be created using new.

License

hydrajs-sandbox-plugin is licensed under MIT license. (see LICENSE file)