Create `withReducer` function
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Usage example
```js
import { compose, withReducer } from 'frint-props';
const props$ = compose(
withReducer(
'counterState',
'dispatchCounter',
(state, action) => state,
{ counter: 0 }
)
)();
```
## API
```js
withState(
stateName: string,
dispatchName: string,
reducer: (state, action) => state,
initialState
)
```
Contributor guide
Research direction
Start by inspecting the existing compose and related prop APIs in frint-props, then compare their public behavior with the usage example. Implement the withReducer API with the stated names, reducer, and initialState parameters, and verify that the resulting props expose counterState and dispatchCounter as shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100