Add some docs and a makefile

This commit is contained in:
Jeremy Wall 2022-12-29 12:30:19 -06:00
parent f74a051bf8
commit d91823a1da
3 changed files with 24 additions and 14 deletions

21
Makefile Normal file
View File

@ -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

View File

@ -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<F, Val>(
&'ctx self,
cx: Scope<'ctx>,

View File

@ -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<Msg, FakeState>,
{
foo: &'ctx Handler<'ctx, D, FakeState, Msg>,
bar: &'ctx Handler<'ctx, D, FakeState, Msg>,
}
pub struct StateMachine();
impl MessageMapper<Msg, FakeState> for StateMachine {