Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
30 Days Of Javascript | 38,596 | a day ago | 1 | January 19, 2022 | 327 | JavaScript | ||||
30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days. This challenge may take more than 100 days, please just follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw | ||||||||||
Zustand | 35,519 | 10 | 1,336 | 15 hours ago | 113 | August 01, 2023 | 6 | mit | TypeScript | |
🐻 Bear necessities for state management in React | ||||||||||
Reactjs Interview Questions | 31,818 | 12 days ago | 18 | JavaScript | ||||||
List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!! | ||||||||||
React Boilerplate | 29,238 | 2 | 3 | 6 months ago | 1 | May 11, 2014 | 116 | mit | JavaScript | |
:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices. | ||||||||||
React Redux | 22,974 | 140,108 | 17,998 | 4 days ago | 126 | July 29, 2023 | 25 | mit | TypeScript | |
Official React bindings for Redux | ||||||||||
30 Days Of React | 22,796 | 3 days ago | 214 | JavaScript | ||||||
30 Days of React challenge is a step by step guide to learn React in 30 days. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw | ||||||||||
React Redux Links | 21,729 | a year ago | 31 | |||||||
Curated tutorial and resource links I've collected on React, Redux, ES6, and more | ||||||||||
Normalizr | 20,987 | 3,388 | 633 | 2 years ago | 43 | March 19, 2022 | 22 | mit | JavaScript | |
Normalizes nested JSON according to a schema | ||||||||||
Responsively App | 20,839 | 21 hours ago | 172 | agpl-3.0 | JavaScript | |||||
A modified web browser that helps in responsive web development. A web developer's must have dev-tool. | ||||||||||
Js Stack From Scratch | 19,396 | 2 | a year ago | 1 | January 19, 2017 | 48 | mit | JavaScript | ||
🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack. |
Rematch is Redux best practices without the boilerplate. No more action types, action creators, switch statements or thunks.
Translations
npm install @rematch/core
or
yarn add @rematch/core
init configures your reducers, devtools & store.
index.js
import { init } from '@rematch/core'
import * as models from './models'
const store = init({
models,
})
export default store
For a more advanced setup, see plugins and Redux config options.
The model brings together state, reducers, async actions & action creators in one place.
models.js
export const count = {
state: 0, // initial state
reducers: {
// handle state changes with pure functions
increment(state, payload) {
return state + payload
},
},
effects: dispatch => ({
// handle state changes with impure functions.
// use async/await for async actions
async incrementAsync(payload, rootState) {
await new Promise(resolve => setTimeout(resolve, 1000))
dispatch.count.increment(payload)
},
}),
}
See the reducers docs to learn more, including how to trigger actions from other models.
Understanding models is as simple as answering a few questions:
dispatch is how we trigger reducers & effects in your models. Dispatch standardizes your actions without the need for writing action types or action creators.
import { init } from '@rematch/core'
import * as models from './models'
const store = init({
models,
})
export const { dispatch } = store
// state = { count: 0 }
// reducers
dispatch({ type: 'count/increment', payload: 1 }) // state = { count: 1 }
dispatch.count.increment(1) // state = { count: 2 }
// effects
dispatch({ type: 'count/incrementAsync', payload: 1 }) // state = { count: 3 } after delay
dispatch.count.incrementAsync(1) // state = { count: 4 } after delay
Dispatch can be called directly, or with the dispatch[model][action](payload)
shorthand.
Rematch can be used with native redux integrations such as "react-redux". See an example below.
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider, connect } from 'react-redux'
import store from './store'
const Count = props => (
<div>
The count is {props.count}
<button onClick={props.increment}>increment</button>
<button onClick={props.incrementAsync}>incrementAsync</button>
</div>
)
const mapState = state => ({
count: state.count,
})
const mapDispatch = ({ count: { increment, incrementAsync } }) => ({
increment: () => increment(1),
incrementAsync: () => incrementAsync(1),
})
const CountContainer = connect(
mapState,
mapDispatch
)(Count)
ReactDOM.render(
<Provider store={store}>
<CountContainer />
</Provider>,
document.getElementById('root')
)
Moving from Redux to Rematch involves very few steps.
For an earlier version, see v0.x docs. Currently only displaying v1.x documentation.
Breaking changes with v1.0.0. Global imports of dispatch
and getState
have been removed. Instead, you can export and import your store, capturing store.dispatch
, store.getState
. See the Changelog for details.
See the @rematch/core API
See the CHANGELOG to see what's new.
Like this project? ★ us on GitHub :)