Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Latest commit

 

History

History
29 lines (18 loc) · 576 Bytes

target.md

File metadata and controls

29 lines (18 loc) · 576 Bytes
prism.target(state)

Returns the original unwatched object.

This function is the same as in onChange.

Enables destructuring the state

Arguments

state (object): The object that you are listening to

Returns

state (object): The original object that was passed to init

Example

import * as prism from 'state-prism'
import state from './state'

const unwatchedState = prism.target(state)

// Now possible to destructure state
const { x, y } = unwatchedState