lit-directive-reactive
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "lit-directive-reactive", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Lit-html directive for observer pattern (Reactive)", | ||
@@ -11,5 +11,8 @@ "main": "lit-directive-reactive.js", | ||
"license": "GPL-3.0", | ||
"dependencies": { | ||
"peerDependencies": { | ||
"lit-html": "^1.3.0" | ||
}, | ||
"files": [ | ||
"lit-directive-reactive.js" | ||
], | ||
"repository": { | ||
@@ -22,3 +25,3 @@ "type": "git", | ||
}, | ||
"module": "./lit-directive-reactive.js", | ||
"module": "lit-directive-reactive.js", | ||
"homepage": "https://github.com/jimmy-collazos/lit-directive-reactive#README", | ||
@@ -38,3 +41,4 @@ "keywords": [ | ||
"xstream" | ||
] | ||
], | ||
"type": "module" | ||
} |
@@ -1,2 +0,2 @@ | ||
![](./header.png) | ||
![](./header.webp) | ||
<sup>_Social Media Photo by [Ryan Stone](https://unsplash.com/@rstone_design) on [Unsplash](https://unsplash.com/photos/OlxJVn9fxz4)_</sup> | ||
@@ -12,10 +12,12 @@ | ||
Esta directiva([lit-html directive](https://lit-html.polymer-project.org/api/modules/_lit_html_.html#directive)) permite enlazar objetos de la programación reactiva (Observable, Subject) en partes del rendirzado de [lit-html](https://lit-html.polymer-project.org/) | ||
This [lit-html directive](https://lit-html.polymer-project.org/api/modules/_lit_html_.html#directive) is for use some parts of your templates like an observable (Reactive programming). | ||
Se puede utilizar junto a librerías como [RxJs](https://rxjs.dev/guide/overview), [most.js](https://github.com/cujojs/most) y [xstream](https://github.com/staltz/xstream). En general con cualquier librería que implemente Observable y Subject | ||
Use with [RxJs](https://rxjs.dev/guide/overview), [most.js](https://github.com/cujojs/most) and [xstream](https://github.com/staltz/xstream) or wharever library with Observable and Subject implementation. | ||
## Uso / Instalación | ||
[See the demo with example](https://stackblitz.com/edit/lit-directive-reactive?file=index.js). | ||
Esta herramienta se exporta en los formatos [ESM](https://developer.mozilla.org/es/docs/Web/JavaScript/Guide/M%C3%B3dulos). Puedes descargarlo o instalarlo a través de [NPM](https://www.npmjs.com/) o desde [Unpkg](https://unpkg.com/). | ||
## Installation | ||
Install from [NPM](https://www.npmjs.com/package/lit-directive-reactive) or use from [Unpkg](https://unpkg.com/lit-directive-reactive) CDN | ||
**Npm** | ||
@@ -30,16 +32,17 @@ ```sh | ||
``` | ||
## API | ||
## # subscribe(observable) | ||
> *Soporte para [AttributePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.attributepart.html), [BooleanAttributePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.booleanattributepart.html), [EventPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.eventpart.html), [NodePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.nodepart.html), [PropertyPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.propertypart.html)* | ||
> *Support for [AttributePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.attributepart.html), [BooleanAttributePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.booleanattributepart.html), [EventPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.eventpart.html), [NodePart](https://lit-html.polymer-project.org/api/classes/_lit_html_.nodepart.html), [PropertyPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.propertypart.html)* | ||
Asigna el valor recibido, en el observable, a la parte ([Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html)) definida. | ||
Update template [Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html) value with received value on Observable (next method) | ||
### _Parámentros_ | ||
* **observable**: Valor observable | ||
### _Parameters_ | ||
* **observable**: Observable object to subscribe | ||
### _Valor Devuelto_ | ||
### _Return value_ | ||
Devuelve un [Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html) de [lit-html](https://lit-html.polymer-project.org/) | ||
return template [Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html) of [lit-html](https://lit-html.polymer-project.org/) | ||
### _Ejemplo_ | ||
### _Example_ | ||
```javascript | ||
@@ -66,14 +69,14 @@ import {render, html} from 'lit-html' | ||
## # toSubject(subject) | ||
> *Actualmente sólo da soporte para [EventPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.eventpart.html)* | ||
> *Currently support for [EventPart](https://lit-html.polymer-project.org/api/classes/_lit_html_.eventpart.html)* | ||
Se suscribe al evento y emite en el [Subject](http://reactivex.io/documentation/subject.html) definido. | ||
Emit event value to [Subject](http://reactivex.io/documentation/subject.html) | ||
### _Parámentros_ | ||
### _Parameters_ | ||
* **subject**: [Subject](http://reactivex.io/documentation/subject.html) to emit event value | ||
### _Valor Devuelto_ | ||
### _Return value_ | ||
Devuelve un [Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html) de [lit-html](https://lit-html.polymer-project.org/) | ||
return template [Part](https://lit-html.polymer-project.org/api/interfaces/_lit_html_.part.html) of [lit-html](https://lit-html.polymer-project.org/) | ||
### _Ejemplo_ | ||
### _Example_ | ||
```javascript | ||
@@ -80,0 +83,0 @@ import {render, html} from 'lit-html' |
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
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
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
27
91
Yes
40601
1
- Removedlit-html@^1.3.0