@universal-packages/dynamic-api
Advanced tools
Comparing version 1.5.0 to 1.5.1
{ | ||
"name": "@universal-packages/dynamic-api", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Dynamic decoupling-adapting system", | ||
@@ -17,3 +17,3 @@ "author": "David De Anda <david@universal-packages.com> (https://github.com/universal-packages)", | ||
"dependencies": { | ||
"@universal-packages/module-loader": "^1.0.0" | ||
"@universal-packages/module-loader": "^1.0.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
@@ -61,15 +61,14 @@ # Dynamic API | ||
## performDynamicSync | ||
### Instance methods | ||
To not waste overhead in async calls perform dynamics synchronically, they of course should implement a sync perform method. | ||
#### **`performDynamic(name: string, payload: Object)`** | ||
```js | ||
const result = dynamicApi.performDynamicSync('calculate', { fast: true }) | ||
Performs a dynamic in an asynchronous way. | ||
console.log(result) | ||
#### **`performDynamicSync(name: string, payload: Object)`** | ||
// > "I did it fast" | ||
``` | ||
To not waste overhead in async calls perform dynamics synchronically, they of course should implement a sync perform method. | ||
## @Dynamic | ||
## Hooks | ||
#### **`@Dynamic(name: string, [default: boolean])`** | ||
@@ -113,4 +112,2 @@ Dynamics are classes as a default export, decorated with `@Dynamic` decorator and implementing the method `perform`. | ||
### Default Dynamics | ||
The whole point of the dynamic API is to be extensible in all posable ways, to be dynamic if we will. When creating a dynamic API you may want to let he user override provided default dynamics, in order to let that happen we mark dynamics as default, if the user creates another dynamic with same name, then that dynamic will be performed instead of the default one. | ||
@@ -133,3 +130,3 @@ | ||
## @DynamicHook | ||
#### **`@DynamicHook(lifeCycle: before | after, name: string)`** | ||
@@ -176,3 +173,3 @@ Hooks allows the user to perform some other tasks `before` and `after` a main dynamic is performed, for example you need to calculate something in a dynamic but need to also log that the calculation was done, instead of overriding the dynamic for your specific case you create a hook to run after the dynamic. | ||
## Even Emitter | ||
## Events | ||
@@ -231,3 +228,3 @@ DynamicApi is an emitter, it does not emit anything by itself but you can use it to communicate to other parts of your app what is going on in your dynamics. | ||
The development of this library in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library. | ||
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library. | ||
@@ -234,0 +231,0 @@ - [Code of Conduct](./CODE_OF_CONDUCT.md) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32010
18
232