ipython / ipython/traitlets

Add support for firing one-time events when observing

Đang mở
#691 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
653
Fork
217
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Mô tả

I have a frequent pattern that comes up time and again with my jupyter widgets (depends on traitlets) and think it would be helpful to have this supported in the API:
```
append_type_radio.observe(toggle_append_type, names='value');
toggle_append_type({'new': toggle_append_radio.value}) # call it once to initialize
```

^-- the above is a hack and I would much prefer a way to have a signal automatically come when subscribing (i.e. eager execution)
or, optionally, a way to manually trigger an event, so that anything that depends on initial state can get updated.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.