We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef95c56 commit d8922d8Copy full SHA for d8922d8
packages/immer/src/immer.spec.ts
@@ -1,7 +1,22 @@
1
import { newAtom } from '@frp-ts/core'
2
import { produceMany } from './immer'
3
+import { produce } from 'immer'
4
5
describe('immer', () => {
6
+ describe('direct integration', () => {
7
+ it('updates the state with "produce"', () => {
8
+ interface State {
9
+ readonly foo: number
10
+ }
11
+ const state = newAtom<State>({ foo: 0 })
12
+ state.modify(
13
+ produce((state) => {
14
+ state.foo++
15
+ }),
16
+ )
17
+ expect(state.get()).toEqual<State>({ foo: 1 })
18
+ })
19
20
describe('produceMany', () => {
21
it('updates nested values', () => {
22
interface State {
0 commit comments