Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/matthewmueller/preact-socrates
- Owner: matthewmueller
- Created: 2016-03-04T07:54:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-04T15:34:38.000Z (almost 9 years ago)
- Last Synced: 2024-09-21T21:23:15.542Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
- awesome-preact - Preact Socrates - Preact plugin for [Socrates](http://github.com/matthewmueller/socrates). (Uncategorized / Uncategorized)
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