This demo repo shows 3 different ways of doing "encapsulation" and "private" like fields.
- flow opaque type with object literal and helper functions to retrieve opaquely hidden field data
- javascript class with private fields and instance methods to retrieve private field data
- javascript class with private fields and getters to retrieve private field data
Run the examples locally:
# Compile the examples (typecheck and build)
make
# Run the demo code
make run