Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/huang2002/hele-hbus

HEle bindings for HBus.
https://github.com/huang2002/hele-hbus

3h bindings hbus hele

Last synced: 3 days ago
JSON representation

HEle bindings for HBus.

Awesome Lists containing this project

README

        

# hele-hbus

HEle bindings for HBus.

# Example

```jsx
const { Bus, Subscription } = HEle, // exported components
busName = 'bus'; // default: HEle.defaultBusName

class PublishButton extends HEle.Component {
constructor(props, context) {
super(props, context);
this.publish = this.publish.bind(this);
}
publish() {
const { [busName]: bus } = this.context;
bus.publish(new HBus.Action('ACTION_TYPE', PAYLOAD));
}
render() {
return Publish an action;
}
}

HEle.render(


{state => (

Current state: {state}


)}


{prop => (

Current prop: {prop}


)}


,
document.getElementById('root')
);
```

# APIs

The example above has shown how to use this lib. If you want the detailed API reference, please read the source files in `src` or the type declaration files in `typings`.

# Changelog

See [CHANGELOG.md](CHANGELOG.md)