def load_notes(dispatch, state): storage = create_storage(state["storage_uri"]) dispatch(loaded_notes(note_list.build_entry(storage.load(note_id)) for note_id in storage.list()))
def on_note_changed(current_note, dispatch): storage = create_storage(current_note['storage_uri']) storage.save(build_note(current_note)) dispatch(saved_note())