frintjs / frintjs/frint-props

Create `withReducer` function

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.