Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matthewmueller/preact-socrates

preact plugin for socrates.
https://github.com/matthewmueller/preact-socrates

Last synced: 3 months ago
JSON representation

preact plugin for socrates.

Awesome Lists containing this project

README

        

# preact-socrates

[Preact](http://github.com/developit/preact) plugin for [socrates](http://github.com/matthewmueller/socrates).

## Install

```bash
npm install preact-socrates
```

## Example

```js
import { render, h } from 'preact-socrates'
import Logger from 'redux-logger'
import Socrates from 'socrates'

/**
* Create our virtual dom tree
*/

const Home = ({ dispatch, greeting }) => (


{ greeting }


dispatch('change greeting', { greeting: 'Hey bud' })}>Change the greeting

)

/**
* Initialize our store
*/

let store = Socrates([
Logger()
])

/**
* Initial application state
*/

store('boot', {
greeting: 'Welcome to the website, friend!'
})

/**
* Render our virtual dom tree to the
*/

render(Home, store, document.body)
```

## License

MIT