Skip to content

Instantly share code, notes, and snippets.

For categories:
ID | Name | Parent_ID
(Parent ID is for category tree)
For products:
ID | Category_ID | Name | Description | Other
Let's say the category tree is like
const createStore = (reducer) =>
{
let state;
let listeners = [];
const getState = () => state;
const dispatch = (action) =>
{
state = reducer(state , action);