mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
drop CurrentEditSession type
It is better to not hide the nullability.
This commit is contained in:
@@ -6,9 +6,7 @@ import { Reducer, combineReducers } from 'redux';
|
||||
import { Action } from '../actions';
|
||||
import { EditorActionType } from '../actions/editor';
|
||||
|
||||
type CurrentEditSession = Ace.EditSession | null;
|
||||
|
||||
const current: Reducer<CurrentEditSession, Action> = (state = null, action) => {
|
||||
const current: Reducer<Ace.EditSession | null, Action> = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case EditorActionType.Current:
|
||||
return action.editSession || null;
|
||||
@@ -18,6 +16,6 @@ const current: Reducer<CurrentEditSession, Action> = (state = null, action) => {
|
||||
};
|
||||
|
||||
export interface EditorState {
|
||||
current: CurrentEditSession;
|
||||
current: Ace.EditSession | null;
|
||||
}
|
||||
export default combineReducers({ current });
|
||||
|
||||
Reference in New Issue
Block a user