Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ChrisFeldmeier/OpenCodeRust
/ new
Method
new
crates/opencode-tui/src/hooks/use_state.rs:10–15 ·
view source on GitHub ↗
(initial: T)
Source
from the content-addressed store, hash-verified
8
9
impl<T: Clone> UseState<T> {
10
pub fn new(initial: T) -> Self {
11
Self {
12
value: Rc::new(RefCell::new(initial)),
13
changed: Rc::new(RefCell::new(false)),
14
}
15
}
16
17
pub fn get(&self) -> T {
18
self.value.borrow().clone()
Callers
nothing calls this directly
Calls
1
new
Function · 0.85
Tested by
no test coverage detected