Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@universal-packages/dynamic-api

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@universal-packages/dynamic-api - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

LICENSE.md

4

package.json
{
"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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc