max-mapper / max-mapper/yo-yo

onBeforeElUpdated for events clobber's user's provided version

Open
#54 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
46
PR merge metrics
No merged PRs in 30d

Description

This was already addressed here originally in PR #44 . but then taken out to simplify that PR. To paraphrase:

We use our own custom onBeforeElUpdated function for memoizing sub-components, but then lose the ability to copy events. We'd need to be able to use both, ideally running the user function before the copier (since the user returning false immediately would make the event copier operations redundant).

I've seen the memoization example from the "choo stateful playground" example (though we aren't using choo directly), but it would be better at least for our purposes to have the isSameNode check internalized once in our main node comparison, rather than needing to include customElement.isSameNode = () => true; comparisons externally at the root of every one of our memoized sub-components (though only after the first update, which again adds more closure boilerplate if the same component is being used multiple times).

If there would be a way to get in @kristoferjoseph s work via this issue that would be great :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the implementation of onBeforeElUpdated and the changes discussed in PR #44. Trace how the custom memoization callback interacts with event copying and isSameNode; done means user callbacks and event copying can coexist with the intended callback ordering and memoization behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.