Skip to main content
Version: 1.0

useSlice()

An useSlice() represents grouped state slice in State-jet.

function useSlice<T>(
sliceKey: string
)
  • sliceKey - A unique string used to identify the slice.

    It returns the following properties:

    • set() – Updates the state data.
    • useState() – Retrieves the latest state data.
    • undo() – Reverts the state to the previous value. Refer (Undo)
    • redo() – Restores the undone state. Refer (Redo)
    • clear() – Resets the state data. Refer (Clear)