Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { combineReducers, Reducer } from 'redux';
import { jsonformsReducer, JsonFormsState } from '@jsonforms/core';
import { angularMaterialRenderers } from '../../src/index';
import { ExampleDescription, getExamples } from '@jsonforms/examples';
export const rootReducer: Reducer = combineReducers({
jsonforms: jsonformsReducer(),
examples: (state: ExampleDescription[] = []) => state
});
export const initialState = {
jsonforms: {
renderers: angularMaterialRenderers
},
examples: {
data: getExamples()
}
};
export const renderExample = (
renderers: { tester: RankedTester; renderer: any }[],
cells: { tester: RankedTester; cell: any }[],
...additionalStoreParams: AdditionalStoreParams[]
) => {
const exampleData = enhanceExample(getExamples());
const store = setupStore(
exampleData,
cells,
renderers,
additionalStoreParams
);
ReactDOM.render(
,
document.getElementById('root')
);
};