Skip to content

Commit

Permalink
refactor(io/SevenSegmentDisplay): minor
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Dec 6, 2023
1 parent f78ce74 commit c2e981a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/features/io/SevenSegmentDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createNextState } from '@reduxjs/toolkit'
import { memo, useEffect, useState } from 'react'
import { map } from 'rxjs'

import { store } from '@/app/store'
import { subscribe } from '@/app/subscribe'
Expand Down Expand Up @@ -144,9 +145,8 @@ const SevenSegmentDisplay = (): JSX.Element | null => {
const [data, setData] = useState(initialData)

useEffect(() => {
return subscribe(store.onAction(resetIoState), () => {
setData(initialData)
})
const resetIoState$ = store.onAction(resetIoState)
return subscribe(resetIoState$.pipe(map(() => initialData)), setData)
}, [])

const {
Expand Down

0 comments on commit c2e981a

Please sign in to comment.