0.2.3 • Published 5 years ago

ipreact v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

IPreact

connect data-actions of preact-components

Install

npm i ipreact

Usage

import IPreact from '../src/ipreact'
import { h, Component, render } from 'preact'
const { connect, dispatch, getState } = IPreact()({
    name: 'world'
})

const AppComponent = ({ words }) => <h2>{words}</h2>
const App = connect(() => ({
    words: `hello ${getState().name}!`
}))(AppComponent)

let i = 0
setInterval(function () {
    const list = ['prect', 'immutable', 'world', 'ipreact']
     i = (i + 1) % list.length
    dispatch(state => ({name: list[i]}))
}, 1000)

hello world

0.2.3

5 years ago

0.2.2

5 years ago

0.2.0

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago