Skip to content

Conversation

@trusktr
Copy link
Member

@trusktr trusktr commented Jan 4, 2026

feat: add a static autoStartEffects option for classes that use the @effect decorator, that when set to false will not auto-start effects on class instantiation. This is useful with startEffects() for starting effects later.

feat: add a new addEffectFn method to Effectful mixing and Effects class for adding an effect function without starting it, as an alternative to the createEffect method, useful for starting added effects later with the startEffects method.

re-export private APIs from _state.ts from the index so that downstream consumers like @lume/element don't have to update importmaps and break consumers

Copilot AI review requested due to automatic review settings January 4, 2026 08:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds flexibility for controlling when effects start by introducing two key features:

  • A static autoStartEffects class property that, when set to false, prevents effects from starting automatically on instantiation
  • An addEffectFn() method for adding effect functions without starting them, enabling manual control via startEffects()

Additionally, the PR renames internal APIs with __ suffixes and re-exports them from the index to prevent breaking changes for downstream consumers like @lume/element.

Reviewed changes

Copilot reviewed 11 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/index.ts Adds re-export of _state.js to expose internal APIs
src/_state.ts Renames internal APIs with __ suffix, adds AutoStartable type and implements auto-start logic
src/mixins/Effectful.ts Adds addEffectFn() method for non-starting effect registration
src/decorators/effect.ts Updates imports to use renamed __ suffixed functions
src/decorators/signal.ts Updates imports and exports SignalOptions interface
src/decorators/untracked.ts Refactors constructor implementation to be more concise
src/decorators/memo.ts Updates imports to use renamed __ suffixed functions
src/signals/*.ts Updates imports to use renamed internal APIs
dist/* Compiled JavaScript and source maps reflecting the changes
test files Adds test coverage for autoStartEffects = false behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trusktr trusktr force-pushed the effect-control branch 2 times, most recently from 580cac8 to 6588ffa Compare January 4, 2026 09:07
… `@effect` decorator, that when set to `false` will not auto-start effects on class instantiation. This is useful with `startEffects()` for starting effects later.

feat: add a new `addEffectFn` method to `Effectful` mixin and `Effects` class for adding an effect function without starting it, as an alternative to the `createEffect` method, useful for starting added effects later with the `startEffects` method.

re-export private APIs from `_state.ts` from the index so that downstream consumers like `@lume/element` don't have to update importmaps and break consumers
@trusktr trusktr merged commit a484cac into main Jan 4, 2026
2 checks passed
@trusktr trusktr deleted the effect-control branch January 4, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants