Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cerebral/preact

Package Overview
Dependencies
Maintainers
6
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerebral/preact

Preact view for Cerebral

  • 4.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

@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>
    }
  }
)

FAQs

Package last updated on 21 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc