Skip to content

Conversation

@magnetised
Copy link
Contributor

Fixes #58

@magnetised magnetised force-pushed the materialize-shape branch 2 times, most recently from 160f2f0 to 9bf7897 Compare August 7, 2025 15:50
This allows you to subscribe to the shape and receive notifications and
also retrieve the current dataset.

`to_list/2` will return the current state of the shape as a list:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experience from working with shapes and collections tells me that to_list is one way you may want the data but having map access, keyed on the ID, is also very helpful. Could you provide has, get, etc.? Or even implement Enumerable? How convenient can we make the data access?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I've added a stream/1,2 function that returns a lazy stream of the data as well as to_map/1,2

I've also added find/3 as a wrapper around stream/1 to simplify finding values in the collection -- I think this is as close to get as we're going to get without going through to_map.

@magnetised magnetised changed the base branch from test-sandbox to main August 12, 2025 10:50
@magnetised magnetised merged commit 97c0e50 into main Aug 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a GenServer based Shape.

3 participants