4.2.1 • Published 3 years ago

@cerebral/preact v4.2.1

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

@cerebral/preact

Preact view for Cerebral.

Install

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

Container

import {h, render} from 'preact'
import {Controller} from 'cerebral'
import {Container} from '@cerebral/preact'
import App from './App'

const controller = Controller({
  state: {
    foo: 'bar'
  },
  signals: {
    clicked: []
  }
})

render((
  <Container controller={controller}>
    <App />
  </Container>
), document.querySelector('#app'))

connect

import {h, Component} from 'preact'
import {connect} from '@cerebral/preact'
import {state, signal} from 'cerebral/tags'

export default connect({
  foo: state`foo`,
  click: signal`clicked`
},
  class MyComponent extends Component {
    render ({foo, click}) {
      return <div onClick={() => click()}>{foo}</div>
    }
  }
)
4.2.1

4 years ago

4.2.0

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.4

5 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.6.0

7 years ago

2.5.0

7 years ago

2.4.0

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago