bitovi / bitovi/use-simple-reducer

Support taking promises for the initial state

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
29
Forks
1
PR merge metrics
No merged PRs in 30d

Description

```
useCart = functioin(){


useAsyncReducer( getCart() ,{

})
}
```

## Considerations

- What would `state` be while the initialState promise is loading?

## How to make this work now

```
useCart = functioin(){


[action] =useAsyncReducer( null ,{
getCart(){}
})
action.getCart()
}
```

Contributor guide

Open the contributing guide

Research direction

The issue names useAsyncReducer and getCart but no files or tests. Start by locating useAsyncReducer and tracing how its initial state is consumed; define the loading-state behavior for a promise initial state, then verify that promise initialization and its resulting state are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.