unsegnor / persistent-programming

Object repository. Just to work with javascript objects implementing transparent persistence. No 'Save' method anymore :)
GNU General Public License v3.0
1 stars 0 forks source link

Add foreach to lists #6

Open unsegnor opened 5 years ago

unsegnor commented 5 years ago

Examples: I want to execute a function for each room in my house I would like to write "house.forEach('rooms', function(){...})"

Rules: Allow executing functions for each element in a list property

Doubts:

Developer Notes: This will let us improve the performance by loading just the elements to be used, caching... in the state implementation.

unsegnor commented 5 years ago

Adding foreach as a class will let us test it exhaustively and also test their use. So reducing tests and increasing coverage. It also could allow us to save the loop state so that we could restart the application after a non planned reboot.