From 387ede71c0eb212dbc4c36078764cdf35e29b41a Mon Sep 17 00:00:00 2001 From: Dmitry Vasilev Date: Sun, 11 Jun 2023 00:04:42 +0300 Subject: [PATCH] refactor --- src/effects.js | 2 +- src/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/effects.js b/src/effects.js index 57373bf..466bcc3 100644 --- a/src/effects.js +++ b/src/effects.js @@ -131,7 +131,7 @@ export const render_initial_state = (ui, state) => { ui.editor.switch_session(state.current_module) } -export const render_common_side_effects = (prev, next, command, ui) => { +export const apply_side_effects = (prev, next, command, ui) => { if( prev.project_dir != next.project_dir || diff --git a/src/index.js b/src/index.js index 14096ce..34cb23c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import {UI} from './editor/ui.js' -import {EFFECTS, render_initial_state, render_common_side_effects} from './effects.js' +import {EFFECTS, render_initial_state, apply_side_effects} from './effects.js' import {load_dir} from './filesystem.js' const EXAMPLE = `const fib = n => @@ -231,7 +231,7 @@ export const exec = (cmd, ...args) => { with_code_execution(() => { - render_common_side_effects(state, nextstate, cmd, ui); + apply_side_effects(state, nextstate, cmd, ui); if(effects != null) { (Array.isArray(effects) ? effects : [effects]).forEach(e => {