From 85a5959a2d50d19b813118d529032fabe946b6d6 Mon Sep 17 00:00:00 2001 From: xlboy Date: Wed, 13 Jul 2022 19:56:29 +0800 Subject: [PATCH] docs(typescript): supplement the missing `)` symbol in the `combine` code example (#1082) * docs(typescript): supplement the missing `)` symbol in the `combine` code example * style(docs/typescript): formatting --- docs/typescript.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/typescript.md b/docs/typescript.md index eecbd4c3..41a6ce88 100644 --- a/docs/typescript.md +++ b/docs/typescript.md @@ -118,12 +118,14 @@ And now `T` gets inferred and you get to annotate `E` too. Zustand has the same Alternatively you can also use `combine` which infers the state instead of you having to type it... ```ts -import create from "zustand" -import { combine } from "zustand/middleware" +import create from 'zustand' +import { combine } from 'zustand/middleware' -const useStore = create(combine({ bears: 0 }, (set) => ({ - increase: (by: number) => set((state) => ({ bears: state.bears + by })), -})) +const useStore = create( + combine({ bears: 0 }, (set) => ({ + increase: (by: number) => set((state) => ({ bears: state.bears + by })), + })) +) ```