Guide / JavaScript /

Register your first object

To start working with dop the first thing we have to do is register a POJO object with the initial state of our APP.

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