Up – Package index » bonsai » Sources » bonsai.bench » cleanup.mlbonsai LICENSE README Library bonsai Library bonsai.bench Library bonsai.example_chat_open_source_native Library bonsai.example_chat_open_source_native_common Library bonsai.extra Library bonsai.focus_ring Library bonsai.protocol Library bonsai.tailwind_colors Library bonsai.test Library bonsai.web Library bonsai.web_test Library bonsai.web_ui_common_components Library bonsai.web_ui_drag_and_drop Library bonsai.web_ui_element_size_hooks Library bonsai.web_ui_extendy Library bonsai.web_ui_file Library bonsai.web_ui_file_from_web_file Library bonsai.web_ui_form Library bonsai.web_ui_freeform_multiselect Library bonsai.web_ui_multi_select Library bonsai.web_ui_query_box Library bonsai.web_ui_reorderable_list Library bonsai.web_ui_typeahead Library bonsai_test_dot Sources bonsai bonsai.bench bonsai.example_chat_open_source_native bonsai.example_chat_open_source_native_common bonsai.extra bonsai.focus_ring bonsai.protocol bonsai.tailwind_colors bonsai.test bonsai.web bonsai.web_test bonsai.web_ui_common_components bonsai.web_ui_drag_and_drop bonsai.web_ui_element_size_hooks bonsai.web_ui_extendy bonsai.web_ui_file bonsai.web_ui_file_from_web_file bonsai.web_ui_form bonsai.web_ui_freeform_multiselect bonsai.web_ui_multi_select bonsai.web_ui_query_box bonsai.web_ui_reorderable_list bonsai.web_ui_typeahead bonsai_test_dot 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open ! Core
open ! Bonsai_test . Arrow
type packed = T : _ Driver . t -> packed
let ( most_recent_driver : packed option ref ) = ref None
let register_driver driver = most_recent_driver := Some ( T driver )
let invalidate_observers =
Core_bench_js . Test . create_with_initialization
~name: "cleaning up observers..."
( fun ` init ->
( match ! most_recent_driver with
| None -> ( )
| Some ( T driver ) -> Driver . invalidate_observers driver ) ;
most_recent_driver := None ;
fun ( ) -> ( ) )
;;