Skip to content

useImmer

A hook to use immer as a Vue hook to manipulate state.

Install

bash

npm i @vue-hooks-plus/use-immer

Auto Import

typescript
import { VueHooksPlusUseImmerResolver } from '@vue-hooks-plus/resolvers'

How to use

The hook is based on immer management status, immer will be installed to ensure normal work in the project

Independent installation @vue-hooks-plus/use-immer

Basic Usage

Params

PropertyDescriptionTypeDefault
stateShallowRefReadonly<ShallowRef<S>>-
updater-Updater<S>-

Options

参数说明类型默认值
initialValue-() => voidany

Source

Source · Document · Demo

Released under the MIT License.