import STATE_KEY from './STATE_KEY' ; const ORIGIN_STATE_FLAG = { } ; export function isOrigin ( value ) { return value === ORIGIN_STATE_FLAG ; } export default function state ( target , key ) ; export default function state < T > ( value ) ; export default function state ( target , key ? ) { if ( ! key ) { return { [ STATE_KEY ] : 'reactive' , value : target , } ; } target [ STATE_KEY ] = { ... target [ STATE_KEY ] } ; target [ STATE_KEY ] [ key ] = ORIGIN_STATE_FLAG ; }