Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Latest commit

 

History

History
22 lines (16 loc) · 700 Bytes

File metadata and controls

22 lines (16 loc) · 700 Bytes

Javascript configuration holder class

I often come across in my JS application that there are a lots of configuration values I want to pass from the server to my Javascript application. This small class was intended to solve this problem in an easy and clear way.

How to use

Create a new config object

Without parameters

var config = new JSConfigurator('default', {});

With some default parameters

var config = new JSConfigurator('default', {
 loaderImageUrl:  '/images/loader.gif',
 ajaxRefreshTime: 1000
});

Add some parameters to a namespace

config.putMore({
    loaderImageUrl:  '/images/loader2.gif',
    ajaxRefreshTime: 2000
}, 'something');