piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 98 forks source link

Suggestion for safer redux-saga types with typed-redux-saga #247

Open chmac opened 3 years ago

chmac commented 3 years ago

Reading this from the docs:

Here is the latest recommendation although it's not fully optimal. If you managed to cook something better, please open an issue to share your finding with us.

This package offers more type safety https://github.com/agiledigital/typed-redux-saga

In the following example, result will be typed with the return type of fn.

import {call} form 'typed-redux-saga/macro'
const result = yield* call(fn)