Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/swiip/power-react


https://github.com/swiip/power-react

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# Power React

Wrapper around React + Recompose + Styled Components + HyperX in order to get a homogeneous API.

Ohh... Its 30 LoC :)

# Example

```javascript
import {
html,
css,
component,
withState,
withHandlers,
withMarkup,
withStyle
} from "../lib";

const Button = component(
withState("name", "setName", "World"),
withHandlers({
toggle: ({ name, setName }) => () =>
setName(name === "World" ? "Swiip" : "World")
}),
withStyle(
({ name }) => css`
color: ${name === "World" ? "black" : "red"};
`
),
withMarkup(
({ name, toggle, className }) => html`

Hello <${Green}>${name}${Green}>!

`
)
);
```