cyclejs-community/cyclejs-modal

Name: cyclejs-modal

Owner: Cycle.js Community

Description: An easy way to open custom modals in a cyclejs app

Created: 2016-11-06 17:53:33.0

Updated: 2017-11-17 20:49:59.0

Pushed: 2017-11-17 15:19:57.0

Homepage: null

Size: 207

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cyclejs-modal

An easy way to open custom modals in a cyclejs app

Documentation is hosted on Github Pages

Use it

npm install --save cyclejs-modal

Example

You can find the examples in the examples/ folder

tion main({ DOM }) {
return {
    DOM: xs.of(button('.button', ['open modal'])),
    modal: DOM.select('.button').events('click')
        .mapTo({
            type: 'open',
            component: isolate(modal, 'myscope')
        } as ModalAction)
};


tion modal({ DOM }) {
return {
    DOM: xs.of(div('.div', [
        span('.span', ['This is a modal. Yeah? :)']),
        button('.button', ['close'])
    ])),
    modal: DOM.select('.button').events('click')
        .mapTo({ type: 'close' } as ModalAction)
};

Try it

Clone it, run npm i && npm run examples


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.