Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (13 sloc) 690 Bytes

Register your first object

To start working with dop the first thing we have to do is register an object or a class instance with the initial state of our APP. Arrays are not allowed.

const state = dop.register({
    todos: [],
    completedCount: 0
console.log(state.todos.length) // 0

Register will return an ES6 Proxy object. Basically, we have created an observable object where can be observed when mutates.

For a more detailed documentation have a look register

Next step

Create an observer