import { action, makeAutoObservable } from 'mobx';

const stateGenerator = () => ({
    starts: 1
})

const stateActionsGenerator = (state: any) => {
    return {
        setStarts(starts: number) {
            state.starts = starts+1
        }
    }
}

const useKnowledgeLibInfoStore = () => {
    const state = makeAutoObservable(stateGenerator());
    const actions = stateActionsGenerator(state);

    const onSetStarts = (a:any)=>{
        actions.setStarts(a)
    }

    return {
        state,
        onSetStarts
    }
}

export default useKnowledgeLibInfoStore();