avo-hq / avo

Build Ruby on Rails apps 10x faster
https://avohq.io
Other
1.53k stars 256 forks source link

Dynamic fields (reactive fields) #2983

Open Paul-Bob opened 4 months ago

Paul-Bob commented 4 months ago

From https://github.com/avo-hq/avo/discussions/1356#discussioncomment-4337013

We want to be able to influence some fields from other fields.

Possible API:

field...
field...

dynamic do
  field :type
  if value[:type] == :something
    field :sub_type_1
  else
    field :subtype_2
  end
end

Let's also explore something like:

field :one, ...
field :two, ...

field :name, listening: [:one, :two], on_notify: -> {
  ...
}

Related:

Paul-Bob commented 1 week ago

https://github.com/avo-hq/avo-3/issues/37