Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Data Binding #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

WIP: Data Binding #25

wants to merge 6 commits into from

Conversation

martindale
Copy link
Member

This is a hand-rolled implementation of data binding, implemented as follows;

  • Expect DOM elements to be [data-model=ResourceName][data-path=/plural-or-singular-id-path]
  • Create in-memory "Model", and;
    • attach Object.observe or Array.observe to trigger events on their changes.
  • Subscribe to /plural-or-singular-id-path via WebSockets
  • Receive JSON-RPC patch methods, that;
    • provide data encoded in JSON-PATCH format
  • Modify in-memory "Model" by applying the JSON-PATCH
  • Re-render the appropriate template to the selected DOM location.

Frankly, this is an extremly naïve approach, but it's working. Definitely due for some benchmarks and comparisons against React and Angular 2.0.0.

Feedback welcome.

@martindale martindale mentioned this pull request Aug 10, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant