TS
TypeScript
Getting strongly typed state, selectors, actions out of the box.
Build pluggable and extendable React application with Reapex
Reapex is written with TypeScript and it offers strongly typed state, selectors, actions. It provides a clean way to create Redux state with NO Redux boilerplate.
import { App } from 'reapex'
const app = new App()
const store = app.createStore()
const CounterModel = app.model('Counter', { total: 50 })
const [mutations] = CounterModel.mutations({
increase: () => state => ({...state, total: state.total + 1}),
decrease: () => state => ({...state, total: state.total - 1}),
})
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
const CounterComponent = () => {
const total = useSelector(CounterModel.selectors.total)
const dispatch = useDispatch()
return (
<>
<button onClick={() => dispatch(mutations.decrease())}>-</button>
{total}
<button onClick={() => dispatch(mutations.increase())}>+</button>
</>
)
}
import { Provider } from 'react-redux'
const store = app.createStore()
const rootElement = document.getElementById('root')
render(
<Provider store={store}>
<CounterComponent />
</Provider>,
rootElement
)
TS
Getting strongly typed state, selectors, actions out of the box.
</>
No Redux boilerplate. No action creators, no action type constants, less maintenance headache.
2.9 KB gzipped. Can be easily adopted to existing React & Redux applications. Progressively migrating to Reapex.
Built with code splitting in mind makes a clear boundary between modules.
Supports plugins. Create reusable plugins and share with others.
Reapex is designed in a way that modules have a clear boundary with each other, it provides a modularized way of creating React application.