Skip to content

React adapter: update useCalendar for kernel + module API #36

Description

@bart-krakowski

Parent

#25

What to build

Update `@tanstack/react-time`'s `useCalendar` hook to consume the new kernel + module API. The hook remains a thin reactive binding — no domain logic lives here. It instantiates the kernel, subscribes to the store via `@tanstack/react-store`, and exposes reactive selectors so components re-render only when the data they consume changes.

Acceptance criteria

  • `useCalendar({ modules, strategy, events, resources })` instantiates a kernel and returns its full API reactively
  • Components subscribed to `days` re-render when the projection changes; components subscribed only to `viewMode` do not re-render on unrelated event changes
  • `strategy: 'client' | 'server'` is accepted and forwarded to the kernel
  • The hook re-exports all Calendar product actions (`addEvent`, `editEvent`, `removeEvent`, `navigate`, `undo`, `redo`, etc.) as stable references
  • `getEventProps(event)` and `getUnavailableRanges(date)` are accessible from the hook return value
  • The Solid adapter (`@tanstack/solid-time`) mirrors the hook shape using Solid's reactive primitives, confirming the core is framework-agnostic
  • All existing `@tanstack/react-time` tests are updated and passing

Blocked by

#29
#30
#31
#32
#33
#34

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions