most-create
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

most-create

Create imperative stream for mostjs, useful for bridging custom events source (e.g react)

npm

Install

npm i -S most-create

Usage

create

Create a mostjs stream with ability to manually emit event. Based on Proxy

Type: function

Context: any

Target: any

Produce: stream

    private inputChangeStream = create<React.SyntheticEvent<HTMLInputElement>>("inputChangeStream");
    ...
    this.inputChangeStream.observe((e) => {
    	this.model.setDisplayValue(e.currentTarget.value);
    });
    ...
    public onInputChange = (e: React.SyntheticEvent<HTMLInputElement>): void => {
    	this.inputChangeStream.emit(e);
    };

License

Apache License 2.0

Package Sidebar

Install

npm i most-create

Weekly Downloads

15

Version

1.0.1

License

Apache 2.0

Unpacked Size

16.8 kB

Total Files

9

Last publish

Collaborators

  • singgum3b