A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/dmkuznetsov/requirejs-registry below:

flowmitry/requirejs-registry: Plugin "Registry" for RequireJS

Plugin "Registry" for RequireJS is wrapper for require.config().

You can set config for any files or directories.

Interface of "Registry" include get-, set- and has- methods.

bower install requirejs-registry

Add section path to config

require.config({
    paths: {
        registry: 'vendor/requirejs-registry/main'
    }
});

Set config values

requirejs.config({
    config: {
        'testFolder': {
            'test': 12345
        }
    }
});

And in your module just use "reqistry"

define(['registry!.'], function(registry) {
    registry.set('abc', 111);
    console.log(registry.get('abc'));

    // From requirejs.config()
    console.log(registry.get('test'));
});

Also, you can use other path, for example, ['registry!./otherPath/moduleName'] for access to config of other module.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4