Skip to content
On this page

useImmer

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

Install


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


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

Auto Import

import { VueHooksPlusUseImmerResolver } from '@vue-hooks-plus/resolvers'
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

SourceDocsDemo