2 unstable releases
0.2.0 | Dec 12, 2021 |
---|---|
0.1.0 | Aug 20, 2021 |
#43 in #side
33 downloads per month
14KB
301 lines
yew-side-effect
Reconcile Side Effects in Yew Applications
This library is inspired by react-side-effect and react-helmet.
Usage
For a complete example, please see Title.
Licence
Copyright 2021 Kaede Hoshikawa
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.
lib.rs
:
Reconcile Side Effects in Yew Applications
This library is inspired by react-side-effect and react-helmet.
Usage
- Define a SideEffectType
Each side effect needs to have a different type(struct).
-
Define a Side Effects Context Provider using
SideEffectProvider<T>
-
Set Side Effects with
SideEffect<SideEffectType>
All side effects will be collected at component's creation order.
Please refer to source code of title
for a complete example.
Dependencies
~13MB
~234K SLoC