Class: Phlex::Reactive::Component::ComputeDefinition
- Inherits:
-
Data
- Object
- Data
- Phlex::Reactive::Component::ComputeDefinition
- Defined in:
- lib/phlex/reactive/component.rb
Overview
A declared client-side computation (data binding). inputs/outputs are
the action-param names of the fields the reducer reads/writes; reducer
is the key a JS function is registered under (Reactive.compute(key, fn)).
The generic controller runs the reducer on input — writing outputs with
NO round trip — then the debounced POST reconciles from the server reply.
input_types (issue #104) is nil for the ARRAY input form (untyped ⇒ the
client coerces every input through Number, the shipped behavior) and a
{ name => type } hash for the typed HASH form (:string reads the field
value raw, :number coerces). inputs stays the ordered name list either
way, so iteration order is preserved and the array-form wire is unchanged.
mirror (issue #159) is nil when undeclared, else a { name => [id
selectors] } map — DECLARED cross-root text mirrors, validated to id
selectors only at declare time (the server half of the two-sided
default-deny; the client interpreter re-checks the shape).
Instance Attribute Summary collapse
-
#input_types ⇒ Object
readonly
Returns the value of attribute input_types.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#mirror ⇒ Object
readonly
Returns the value of attribute mirror.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#reducer ⇒ Object
readonly
Returns the value of attribute reducer.
Instance Attribute Details
#input_types ⇒ Object (readonly)
Returns the value of attribute input_types
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def input_types @input_types end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def inputs @inputs end |
#mirror ⇒ Object (readonly)
Returns the value of attribute mirror
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def mirror @mirror end |
#name ⇒ Object (readonly)
Returns the value of attribute name
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def name @name end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def outputs @outputs end |
#reducer ⇒ Object (readonly)
Returns the value of attribute reducer
105 106 107 |
# File 'lib/phlex/reactive/component.rb', line 105 def reducer @reducer end |