Трафарет с RxJS 6 - PullRequest
       9

Трафарет с RxJS 6

0 голосов
/ 26 февраля 2019

Я столкнулся с проблемой при использовании трафарета с rxjs 6

Просто создал компонент трафарета, выполнив npm init stencil и выбрал component из списка.

Добавил rxjs в package.json и обновлен трафарет до последней версии:

  "devDependencies": {
    "@stencil/core": "^0.18.0",
    "rxjs": "^6.4.0"
  }

Создан простой компонент:

import { Component, Element } from '@stencil/core';
import { fromEvent } from 'rxjs';
import { throttleTime } from 'rxjs/operators';

@Component({
  tag: 'my-component',
  shadow: true
})
export class MyComponent {
  @Element() el: HTMLElement;

  componenDidLoad() {
    const btn = this.el.shadowRoot.getElementById('btn');
    const clicks = fromEvent(btn, 'click');
    const result = clicks.pipe(throttleTime(1000));
    result.subscribe(x => console.log(x));
  }
  render() {
    return <button id="btn">click me</button>;
  }
}

и на npm run start появилась пустая страница со следующей ошибкой в ​​консоли браузера:

TypeError: Cannot read property 'h' of undefined

enter image description here

1 Ответ

0 голосов
/ 19 мая 2019

эта проблема решена в @ stencil / core @ 1.0.0-beta.1

...