Nearest Phase Modulator

    @cerebral/preact

    4.2.1 • Public • Published

    @cerebral/preact

    Preact view for Cerebral.

    Install

    npm install @cerebral/preact preact babel-preset-preact

    Container

    import { h, render } from 'preact'
    import App from 'cerebral'
    import { Container } from '@cerebral/preact'
    import AppComponent from './components/AppComponent'
    import main from './main'
    
    const app = App(main)
    
    render(
      <Container app={app}>
        <App />
      </Container>,
      document.querySelector('#app')
    )

    connect

    import { h, Component } from 'preact'
    import { connect } from '@cerebral/preact'
    import { state, sequences } from 'cerebral'
    
    export default connect(
      {
        foo: state`foo`,
        onClick: sequences`onClick`
      },
      class MyComponent extends Component {
        render({ foo, click }) {
          return <div onClick={() => onClick()}>{foo}</div>
        }
      }
    )

    Keywords

    none

    Install

    npm i @cerebral/preact

    DownloadsWeekly Downloads

    296

    Version

    4.2.1

    License

    MIT

    Unpacked Size

    19.8 kB

    Total Files

    11

    Last publish

    Collaborators

    • cerebral.js
    • christianalfoni
    • guria
    • gbucher
    • henri-hulski
    • fweinb