New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

lit-rx

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-rx

RxJS utils to be used with lit-html.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

lit-rx

RxJS utils to be used with lit-html.

Usage

subscribe

The subscribe directive can be used to render data emitted by a subscribable or by a promise like.

It works pretty much like Angular's async pipe and it can be binded to any type of lit-html template part (content binding, attribute binding, boolean attribute binding, event binding and property binding should all work).

Here is a tiny example that binds an observable to a boolean attribute:

import { html, render } from 'lit-html';
import { from } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { subscribe } from 'lit-rx'; // or 'lit-rx/subscribe'

const dataPromise = new Promise(resolve => setTimeout(() => resolve('data'), 3000));

const loading$ = from(dataPromise).pipe(
  map(data => !data),
  startWith(true),
);

render(
  html`<my-loading ?shown="${subscribe(loading$)}"></my-loading>`,
  document.body,
);

FAQs

Package last updated on 11 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts