All Projects → azmenak → use-saga-reducer

azmenak / use-saga-reducer

Licence: other
Use redux-saga without redux

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to use-saga-reducer

Redux Most
Most.js based middleware for Redux. Handle async actions with monadic streams & reactive programming.
Stars: ✭ 137 (+90.28%)
Mutual labels:  sagas, redux-saga
Redux Saga
An alternative side effect model for Redux apps
Stars: ✭ 21,975 (+30420.83%)
Mutual labels:  sagas, redux-saga
next-redux-saga-boilerplate
Next/Redux/Saga boilerplate - Example of using Next.js 9 with Redux Saga
Stars: ✭ 13 (-81.94%)
Mutual labels:  sagas, redux-saga
coconat
🍥 StarterKit Builder for rocket-speed App creation on 🚀 React 17 + 📙 Redux 4 + 🚠 Router 5 + 📪 Webpack 5 + 🎳 Babel 7 + 📜 TypeScript 4 + 🚔 Linters 23 + 🔥 HMR 3
Stars: ✭ 95 (+31.94%)
Mutual labels:  hooks, redux-saga
Redux Tower
Saga powered routing engine for Redux app.
Stars: ✭ 155 (+115.28%)
Mutual labels:  sagas, redux-saga
Kea
Production Ready State Management for React
Stars: ✭ 1,805 (+2406.94%)
Mutual labels:  sagas, redux-saga
React Native Navigation Redux Starter Kit
React Native Navigation(v2) Starter Kit with Redux, Saga, ESLint, Babel, Jest and Facebook SDK 😎
Stars: ✭ 271 (+276.39%)
Mutual labels:  sagas, redux-saga
Redux Saga Testing
A no-brainer way of testing your Sagas
Stars: ✭ 150 (+108.33%)
Mutual labels:  sagas, redux-saga
React Redux Hooks Starter
React-redux boilerplate using hooks 🎣
Stars: ✭ 69 (-4.17%)
Mutual labels:  hooks, redux-saga
saga-monitor
Simple, elegant, and configurable redux-saga monitor
Stars: ✭ 37 (-48.61%)
Mutual labels:  sagas, redux-saga
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (+986.11%)
Mutual labels:  hooks
tacklebox
🎣React UX components for handling common interactions
Stars: ✭ 15 (-79.17%)
Mutual labels:  hooks
hooks
A DLL that performs IAT hooking
Stars: ✭ 21 (-70.83%)
Mutual labels:  hooks
wagmi
React Hooks for Ethereum
Stars: ✭ 1,691 (+2248.61%)
Mutual labels:  hooks
react-easy-ssr
🔥 React Starter Project with Webpack 5, Babel 7, TypeScript, Redux-saga, Styled-components, React-jss, Split code, Server Side Rendering.
Stars: ✭ 31 (-56.94%)
Mutual labels:  redux-saga
use-debugger-hooks
A small package of custom React hooks that are useful for debugging changes in React hook dependencies across renders
Stars: ✭ 44 (-38.89%)
Mutual labels:  hooks
architectury-api
An intermediary api aimed at easing development of multiplatform mods.
Stars: ✭ 139 (+93.06%)
Mutual labels:  hooks
feathers-shallow-populate
Feathersjs populate relational data
Stars: ✭ 21 (-70.83%)
Mutual labels:  hooks
useAudioPlayer
Custom React hook & context for controlling browser audio
Stars: ✭ 176 (+144.44%)
Mutual labels:  hooks
eventrix
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.
Stars: ✭ 35 (-51.39%)
Mutual labels:  hooks

use-saga-reducer

npm codecov Build Status NPM

Use sagas without redux! This library provides an abstraction over Redux Saga's External API.

Install

npm install use-saga-reducer

Usage

import useSagaReducer from 'use-saga-reducer'
import {takeLatest, call, put} from 'redux-saga/effects'

function* dataFetcher() {
  try {
    const data = yield call(API.fetchData)
    yield put({type: 'FETCH_SUCCESS', payload: data})
  } catch (error) {
    yield put({type: 'FETCH_ERROR'})
  }
}

function* dataFetchingSaga() {
  yield takeLatest('FETCH', dataFetcher)
}

function reducer(state = {}, action) {
  if (action.type === 'FETCH_SUCCESS') {
    return action.payload
  }

  return state
}

const DataFetchingComponent: React.FC = () => {
  const [state, dispatch] = useSagaReducer(dataFetchingSaga, reducer)

  return (
    <>
      <pre>{state}</pre>
      <button onClick={() => dispatch({type: 'FETCH'})}>Fetch Data</button>
    </>
  )
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].