mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 05:14:28 -08:00
implement code snippet sharing
This commit is contained in:
@@ -248,12 +248,13 @@ const input = (state, code, index) => {
|
||||
set_cursor_position({...state, files}, index),
|
||||
[state.current_module]
|
||||
)
|
||||
const effect_save = next.current_module == ''
|
||||
? {type: 'save_to_localstorage', args: ['code', code]}
|
||||
: {type: 'write', args: [
|
||||
const effect_save = {
|
||||
type: 'write',
|
||||
args: [
|
||||
next.current_module,
|
||||
next.files[next.current_module],
|
||||
]}
|
||||
]
|
||||
}
|
||||
return {state: next, effects: [effect_save]}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user