import { InjectionToken } from '@angular/core';
import { ActionReducerMap } from '@ngrx/store';

import * as fromBlock from './block.reducer';

export interface State {
    block: fromBlock.State;
}

// -----------------
// ------------ AOT
export const TOKEN = new InjectionToken<ActionReducerMap<State>>('@module.class.name@Reducers');

export function getReducers(): ActionReducerMap<State, any> {
    return {
        block: fromBlock.reducer,
    };
}

export const reducerProvider = [
    { provide: TOKEN, useFactory: getReducers },
];
