diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4d41151 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Copyright 2022 Jeremy Wall (Jeremy@marzhilsltudios.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +build: + cargo build + +test: test-firefox + +test-%: + wasm-pack test --$* --headless . --features async \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index fa2396c..82941cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,7 +65,9 @@ where } /// Binds a triggering signal and associated message mapping function as - /// a state update for this Handler instance. + /// a state update for this Handler instance. This uses [`create_effect`] + /// so be aware that it will fire at least once when you first call it. It + /// is really easy to introduce an infinite signal update loop. pub fn bind_trigger( &'ctx self, cx: Scope<'ctx>, diff --git a/src/tests/mod.rs b/src/tests/mod.rs index ce10be6..d4e5ac1 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -27,19 +27,6 @@ pub struct FakeState { value_two: i32, } -pub enum MultiMsg { - Foo(Msg), - Bar(Msg), -} - -pub struct MultiState<'ctx, D> -where - D: MessageMapper, -{ - foo: &'ctx Handler<'ctx, D, FakeState, Msg>, - bar: &'ctx Handler<'ctx, D, FakeState, Msg>, -} - pub struct StateMachine(); impl MessageMapper for StateMachine {