1.1.11 • Published 6 years ago
hooco v1.1.11
hooco
React hooks & contextual API for apps binding.
import hooco from 'hooco'
export function Counter(state) {
const {counter = 0} = state();
function inc() {
state({counter: counter + 1})
}
return {
counter,
inc
};
}
export const {
use: useCounter,
Provider: CounterProvider,
Consumer: CounterConsumer,
} = hooco(Counter)
/// ----
function App() {
const {counter, inc} = useCounter();
return <div>
<h2>Counter: {counter}</h2>
<button onClick={inc}>inc</button>
</div>
}
1.1.11
6 years ago
1.1.10
6 years ago
1.1.9
6 years ago
1.1.8
6 years ago
1.1.7
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago