cycle-ink-driver
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.0 • Public • Published

    cycle-ink-driver

    Ink driver for Cycle.js

    import { ReactSource } from '@cycle/react';
    import { run } from '@cycle/run';
    import { makeInkDriver } from 'cycle-ink-driver';
    import InkTextInput from 'ink-text-input';
    import { Stream } from 'xstream';
     
    const sels = {
        name: Symbol('name'),
    };
     
    function main({ react }: { react: ReactSource }): { react: Stream<JSX.Element> } {
        const name$: Stream<string> = react.select(sels.name).events('change');
        const view$ = name$.map(name => <InkTextInput sel={sels.name} value={name} onChange={() => {}} />);
     
        return {
            react: view$,
        };
    }
     
    run(main, {
        react: makeInkDriver(),
    });

    Keywords

    none

    Install

    npm i cycle-ink-driver

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    4.05 kB

    Total Files

    9

    Last publish

    Collaborators

    • ryota-ka