Component accessing

Once you're application was successfully initialized, all the components you've registered in the Thorin app are available and accessible throughout the application. Since Thorin acts as a global singleton, all registered component instances will be cached and accessed by their name.

thorin.store(name) : storeObj
Returns the store instance that was registered with the given name or null if non existing.
  • namestring*the name of the store
thorin.plugin(name) : pluginObj
Returns the plugin instance that was registered with the given name or null if non existing.
  • namestring*the name of the plugin
thorin.transport(name) : storeObj
Returns the transport instance that was registered with the given name or null if non existing.
  • namestring*the name of the transport
thorin.lib(name) : libraryObj
Returns the library instance that was registered with the given name or null if non existing.
  • namestring*the name of the library
Example
'use strict';
// File: actions/myAction.js
const thorin = require('thorin'),   // or global.thorin
   store = thorin.store('sql');

const MyModel = store.model('myModel');   // model() function from the sql store instance.
Do you have a question or is something missing?

You can always create a new issue on GitHub or contact one of the core founders by chat.