yamiteru / reculus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency injection

yamiteru opened this issue · comments

  • Get
// if used inside effect or reactive value it should auto-inject
const currentCount = get(count);
  • Set
// automatically triggers listeners if mapped value is not undefined
set(count, 2);
  • $
// get facade
const currentCount = $(count);

// set facade
$(count, 2);
  • Effect
effect(() => {
  console.log($(count));
});
  • Computed
const count = $int(0);
const double = $int(0, () = $(count) * 2);