mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? - Add Visibility SearchAttribute and Memo provider interface. If a root component implements those interfaces, and also uses a Visibility component, CHASM framework will automatically invoke those two interfaces and sync SA & memo. ## Why? - This saves component author from calling UpdateSA/Memo() method whenever some attributes get updated. They can focus on updating the component state and CHASM automatically perform the updates to visibility ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [x] added new functional test(s)
27 lines
557 B
Go
27 lines
557 B
Go
package chasm
|
|
|
|
// CoreLibrary contains built-in components maintained as part of the CHASM framework.
|
|
type CoreLibrary struct {
|
|
UnimplementedLibrary
|
|
}
|
|
|
|
func (b *CoreLibrary) Name() string {
|
|
return "core"
|
|
}
|
|
|
|
func (b *CoreLibrary) Components() []*RegistrableComponent {
|
|
return []*RegistrableComponent{
|
|
NewRegistrableComponent[*Visibility]("vis"),
|
|
}
|
|
}
|
|
|
|
func (b *CoreLibrary) Tasks() []*RegistrableTask {
|
|
return []*RegistrableTask{
|
|
NewRegistrableSideEffectTask(
|
|
"visTask",
|
|
defaultVisibilityTaskHandler,
|
|
defaultVisibilityTaskHandler,
|
|
),
|
|
}
|
|
}
|