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) · 397 Bytes

init.md

File metadata and controls

29 lines (18 loc) · 397 Bytes
prism.init(state)

Enable subscribing to changes.

Arguments

state (object): The object you want to listen to.

Returns

state (object): The same object that is now possible to subscribe to.

Example

I usually put my state in a file called state.js

state.js

import * as prism from 'state-prism'

const state = {
  x: 0,
}

export default prism.init(state)