Skip to content

Commit

Permalink
Fix issues after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ranile committed Jun 6, 2021
1 parent 365d71c commit 2362c82
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 31 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ members = [
"examples/boids",
"examples/counter",
"examples/crm",
"examples/dashboard",
"examples/dyn_create_destroy_apps",
"examples/file_upload",
"examples/futures",
Expand Down
5 changes: 3 additions & 2 deletions examples/dyn_create_destroy_apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ license = "MIT OR Apache-2.0"
[dependencies]
js-sys = "0.3"
yew = { path = "../../packages/yew" }
yew-services = { path = "../../packages/yew-services" }
slab = "0.4.3"

gloo = "0.2"
wasm-bindgen = "0.2"
weblog = "0.3"

[dependencies.web-sys]
version = "0.3.50"
Expand Down
17 changes: 5 additions & 12 deletions examples/dyn_create_destroy_apps/src/counter.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use std::time::Duration;
use gloo::timers::callback::Interval;
use yew::prelude::*;
use yew_services::{
interval::{IntervalService, IntervalTask},
ConsoleService,
};

pub struct CounterModel {
counter: usize,
props: CounterProps,
_interval_task: IntervalTask,
_interval: Interval,
}

#[derive(Clone, Properties)]
Expand All @@ -27,14 +23,11 @@ impl Component for CounterModel {

fn create(props: Self::Properties, link: ComponentLink<Self>) -> Self {
// Create a Tick message every second
let interval_task = IntervalService::spawn(
Duration::from_secs(1),
link.callback(|()| Self::Message::Tick),
);
let interval = Interval::new(1, move || link.send_message(Self::Message::Tick));
Self {
counter: 0,
props,
_interval_task: interval_task,
_interval: interval,
}
}

Expand Down Expand Up @@ -73,6 +66,6 @@ impl Component for CounterModel {
}

fn destroy(&mut self) {
ConsoleService::log("CounterModel app destroyed");
weblog::console_log!("CounterModel app destroyed");
}
}
1 change: 0 additions & 1 deletion examples/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ rand = { version = "0.8", features = ["small_rng"] }
wasm-logger = "0.2"
yew = { path = "../../packages/yew" }
yew-router = { path = "../../packages/yew-router" }
yewtil = { path = "../../packages/yewtil" }
serde = { version = "1.0", features = ["derive"] }
lazy_static = "1.4.0"
gloo = "0.2"
1 change: 0 additions & 1 deletion examples/router/src/pages/page_not_found.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use yew::prelude::*;
use yew::utils::NeqAssign;

pub struct PageNotFound;

Expand Down
8 changes: 4 additions & 4 deletions packages/yew-agent/src/link.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use super::*;
use yew::callback::Callback;
use yew::html::ImplicitClone;
use yew::scheduler::{self, Runnable, Shared};
use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
use std::future::Future;
use std::rc::Rc;
use wasm_bindgen_futures::spawn_local;
use yew::callback::Callback;
use yew::html::ImplicitClone;
use yew::scheduler::{self, Runnable, Shared};

/// Defines communication from Worker to Consumers
pub(crate) trait Responder<AGN: Agent> {
Expand Down
1 change: 0 additions & 1 deletion packages/yew-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ features = [

[dev-dependencies]
wasm-bindgen-test = "0.3"
yew-functional = { path = "../yew-functional" }
serde = { version = "1.0", features = ["derive"] }

[dev-dependencies.web-sys]
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! ```rust
//! # use yew::prelude::*;
//! # use yew_functional::*;
//! # use yew::functional::*;
//! # use yew_router::prelude::*;
//!
//! #[derive(Debug, Clone, Copy, PartialEq, Routable)]
Expand Down
2 changes: 1 addition & 1 deletion packages/yew-router/tests/router.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
use wasm_bindgen_test::{wasm_bindgen_test as test, wasm_bindgen_test_configure};
use yew::functional::function_component;
use yew::prelude::*;
use yew_functional::function_component;
use yew_router::prelude::*;

mod utils;
Expand Down
2 changes: 1 addition & 1 deletion packages/yew/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn with(f: impl FnOnce(&mut Scheduler)) {

/// Push a generic Runnable to be executed
#[inline]
pub(crate) fn push(runnable: Box<dyn Runnable>) {
pub fn push(runnable: Box<dyn Runnable>) {
with(|s| s.main.push_back(runnable));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ mod common;

use common::obtain_result;
use wasm_bindgen_test::*;
use yew::functional::{FunctionComponent, FunctionProvider};
use yew::{html, Html, Properties};
use yew_functional::{FunctionComponent, FunctionProvider};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/use_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ mod common;
use common::obtain_result_by_id;
use std::rc::Rc;
use wasm_bindgen_test::*;
use yew::{html, Children, ContextProvider, Html, Properties};
use yew::functional::{
use_context, use_effect, use_ref, use_state, FunctionComponent, FunctionProvider,
};
use yew::{html, Children, ContextProvider, Html, Properties};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/use_effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use common::obtain_result;
use std::ops::{Deref, DerefMut};
use std::rc::Rc;
use wasm_bindgen_test::*;
use yew::{html, Html, Properties};
use yew::functional::{
use_effect_with_deps, use_ref, use_state, FunctionComponent, FunctionProvider,
};
use yew::{html, Html, Properties};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/use_reducer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ mod common;

use common::obtain_result;
use wasm_bindgen_test::*;
use yew::{html, Html};
use yew::functional::{
use_effect_with_deps, use_reducer_with_init, FunctionComponent, FunctionProvider,
};
use yew::{html, Html};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/use_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ mod common;
use common::obtain_result;
use std::ops::DerefMut;
use wasm_bindgen_test::*;
use yew::{html, Html};
use yew::functional::{use_ref, use_state, FunctionComponent, FunctionProvider};
use yew::{html, Html};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down
2 changes: 1 addition & 1 deletion packages/yew/tests/use_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ mod common;

use common::obtain_result;
use wasm_bindgen_test::*;
use yew::{html, Html};
use yew::functional::{use_effect_with_deps, use_state, FunctionComponent, FunctionProvider};
use yew::{html, Html};

wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);

Expand Down

0 comments on commit 2362c82

Please sign in to comment.