Skip to content

Commit

Permalink
Sync docs of Ribir@refs/heads/master
Browse files Browse the repository at this point in the history
  • Loading branch information
rchangelog[bot] committed Jan 14, 2025
1 parent 9ce4d31 commit 18193e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/get_started/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ struct AppData {
}

let state = State::value(AppData { count: 0 });
let map_count = state.map_writer(|d| PartData::from_ref_mut(&mut d.count));
let split_count = state.split_writer(|d| PartData::from_ref_mut(&mut d.count));
let map_count = state.map_writer(|d| PartMut::new(&mut d.count));
let split_count = state.split_writer(|d| PartMut::new(&mut d.count));

watch!($state.count).subscribe(|_| println!("Parent data"));
watch!(*$map_count).subscribe(|_| println!("Child(map) data"));
Expand Down Expand Up @@ -759,7 +759,7 @@ struct AppData {
}

let state: State<AppData> = State::value(AppData { count: 0 });
let split_count = state.split_writer(|d| PartData::from_ref_mut(&mut d.count));
let split_count = state.split_writer(|d| PartMut::new(&mut d.count));

// the root state's origin state is itself
let _: &State<AppData> = state.origin_reader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ struct AppData {
}

let state = State::value(AppData { count: 0 });
let map_count = state.map_writer(|d| PartData::from_ref(&mut d.count));
let split_count = state.split_writer(|d| PartData::from_ref(&mut d.count));
let map_count = state.map_writer(|d| PartMut::new(&mut d.count));
let split_count = state.split_writer(|d| PartMut::new(&mut d.count));

watch!($state.count).subscribe(|_| println!("父状态数据"));
watch!(*$map_count).subscribe(|_| println!("子状态(转换)数据"));
Expand Down Expand Up @@ -762,7 +762,7 @@ struct AppData {
}

let state: State<AppData> = State::value(AppData { count: 0 });
let split_count = state.split_writer(|d| PartData::from_ref(&mut d.count));
let split_count = state.split_writer(|d| PartMut::new(&mut d.count));

// 根状态的源状态是它自己
let _: &State<AppData> = state.origin_reader();
Expand Down

0 comments on commit 18193e2

Please sign in to comment.