import {createStore, Action} from "redux";

export interface IRootState{
    squares : Array<string|null>
    oIsNext: boolean

const initialState = {
    squares: [],
    oIsNext: true

const rootReducer = (state:IRootState = initialState) => {
    return {
        squares: [null,null,null,null,'O','X',null,null,null],
        oIsNext: true

const store = createStore<IRootState,Action<any>,{},{}>(rootReducer);
export default store;

downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter