fable 3.0.30 → 3.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fable",
3
- "version": "3.0.30",
3
+ "version": "3.0.31",
4
4
  "description": "An entity behavior management and API bundling library.",
5
5
  "main": "source/Fable.js",
6
6
  "scripts": {
@@ -48,6 +48,13 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
48
48
  }
49
49
  }
50
50
 
51
+ // This is for the services that are meant to run mostly single-instance so need a default at initialization
52
+ addAndInstantiateServiceType(pServiceType, pServiceClass)
53
+ {
54
+ this.addServiceType(pServiceType, pServiceClass);
55
+ this.instantiateServiceProvider(pServiceType, {}, `${pServiceType}-Default`);
56
+ }
57
+
51
58
  instantiateServiceProvider(pServiceType, pOptions, pCustomServiceHash)
52
59
  {
53
60
  // Instantiate the service
package/source/Fable.js CHANGED
@@ -53,10 +53,8 @@ class Fable
53
53
  // Initialize and instantiate the default baked-in Data Arithmatic service
54
54
  this.serviceManager.addServiceType('Template', libFableServiceTemplate);
55
55
  this.serviceManager.addServiceType('MetaTemplate', libFableServiceMetaTemplate);
56
- this.serviceManager.addServiceType('DataArithmatic', libFableServiceDataArithmatic);
57
- this.fable.serviceManager.instantiateServiceProvider('DataArithmatic');
58
- this.serviceManager.addServiceType('Utility', libFableServiceUtility);
59
- this.fable.serviceManager.instantiateServiceProvider('Utility');
56
+ this.serviceManager.addAndInstantiateServiceType('DataArithmatic', libFableServiceDataArithmatic);
57
+ this.serviceManager.addAndInstantiateServiceType('Utility', libFableServiceUtility);
60
58
  this.serviceManager.addServiceType('Operation', libFableServiceOperation);
61
59
  this.serviceManager.addServiceType('RestClient', libFableServiceRestClient);
62
60