Gaia/Settings/docs: Difference between revisions

Line 48: Line 48:
== Modules in Settings ==
== Modules in Settings ==
=== Define Modules ===
=== Define Modules ===
Settings modules are AMD modules. In addition to following the syntax of AMD modules, settings app also requires the returning object not to be a constructor function. The reason is that we are then able to expect that all returning functions can be used without the "new" keyword. The other advantage is that the returning functions can be seen as factory methods. A factory method can return different type of objects based on the parameters, which is useful in some use cases.
Settings modules are AMD modules. In addition to following the syntax of AMD modules, settings app also requires that the returning object must not a constructor function. Thus we can expect that all modules are able to be used without a "new" keyword. The other advantage is that the returning functions can be seen as factory methods. A factory method can return different type of objects based on the parameters, which is useful in certain use cases.


=== Configure Requirejs ===
=== Configure Requirejs ===
Confirmed users
502

edits