Add isOfType helper
See original GitHub issueUse case - a redux saga that is run when two actions dispatched, one with payload, other w/o payload
const fetchEntity = createActionCreator('FETCH', resolve => (id: string) => resolve(id));
const reFetchEntity = createActionCreator('RE_FETCH')
function* watchFetchEntity() {
yield takeLastest([getType(fetchEntity), getType(reFetchEntity)], fetchEntitySaga);
}
function* fetchEntitySaga(action: ActionType<typeof fetchEntity> | ActionType<typeof reFetchEntity>) {
const id = isOfType(getType(fetchEntity), action)
? action.payload // id from fetchEntity
: yield select(selectEntityId)
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Instantiate objects using a helper class - Stack Overflow
The problem I have is that i can create an instance of the car object such as, Car car1 = new car("Audi","A4","BF10YMR"); however...
Read more >Documentation - Advanced Types - TypeScript
This page lists some of the more advanced ways in which you can model types, it works in tandem with the Utility Types...
Read more >Error when try to create and array: The 'from' property value in ...
Solved: Hi, I try to create an array but I get an error: The 'from' property value in the 'table' action inputs is...
Read more >Typesafe utilities for "action-creators" in Redux / Flux ... - GitHub
We have an equivalent helper ( isOfType ) which accept type-constants as parameter providing the same functionality. // epics.ts import { isOfType }...
Read more >ATL/User Guide - The ATL Language - Eclipsepedia
The thisModule variable makes it possible to access the helpers and ... a copy of self with the element o added at the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This feature will release in version 3.1.0. Thanks to @kotarella1110 and @nikolay-borzov.
🎉 This issue has been resolved in version 3.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀