Skip to main content

Getting started

Installation & Setup​

npm install olik

Creating a store​

Olik supports arbitrarily deep state-trees, however just like with Redux, normalizing your state is still advised.

import { createStore } from 'olik'

export const store = createStore({
name: document.title, // can be any user-defined string
state: { hello: 'world' } // can be any plain Javascript object
})

Integrating with Redux Devtools​

You can integrate with the Redux Devtools by importing the related module before you create your store.

import { importOlikReduxDevtoolsModule } from 'olik'

importOlikReduxDevtoolsModule()