SignalModelConstructor<T> class

A constructor for models that manages nested effects.

The model constructor starts capturing effects when called, storing them inside the returned SignalModel.

Example Usage

import 'package:preact_signals/preact_signals.dart';

final myModel = SignalModelConstructor(() => 'data');
final model = myModel();
print(model.value); // Prints: data

Constructors

SignalModelConstructor(T _factory(), {SignalModelOptions options = const SignalModelOptions()})
Creates a new instance of SignalModelConstructor.

Properties

hashCode int
The hash code for this object.
no setterinherited
options SignalModelOptions
Options used to configure this constructor.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call() SignalModel<T>
Instantiates a new SignalModel instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited