Skip to content

Commit

Permalink
Add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyObtiva committed Jun 30, 2024
1 parent a87278f commit 30dcaec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Related TODO files:

## Next

- Observe an array or nested arrays for all children changes on a specific property (e.g. observe(@game, 'tetris_blocks[][].color') ; returns |new_color, tetris_block| / observe(@game.players, '[].name') ; returns |name, player|)
- Observe multiple attributes (e.g. observe(@game, [:width, :height]) returns |value, attribute_name|)
- Fix issue with computed data-binding when combined with nested/indexed data-binding (it looks up computed attributes on root object instead of nested object, it seems)
- Support nested computed attributes (e.g. computed_by: {address1: [:street, :city, :state, :zip]})
- Consider the idea of having Observer#observe accept an optional block to do observation without implementing `call` (kinda like when using the `observe` keyword in the Glimmer DSL).
- Observe an array for all children changes on a specific property (e.g. observe(@game, 'blocks[][].color') ; returns |new_color, block|)
- Ensure removing observers from hash in ObservableModel when removed from observable
- Avoid `< Struct.new` in specs (tests)
- Add built-in support to Glimmer::DSL::Engine to memoize/cache expressions similar to how that is supported for StaticExpression (but allowing an outside keyword and non-static expression to be used)
Expand Down
2 changes: 2 additions & 0 deletions lib/glimmer/data_binding/model_binding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def nested_property_observers_for(observer)
end

def add_observer(observer, extra_options = {})
# TODO couldn't we have a scenario where it is both computed? and nested_property? at the same time?
# or computed and not nested at the same time (else statement)?
if computed?
add_computed_observers(observer)
elsif nested_property?
Expand Down

0 comments on commit 30dcaec

Please sign in to comment.