Skip to content

Custom Events #25

Description

@dariomannu

Custom Events in templates: a potential new feature being considered.

const onenter = /* impl TBD */
const stream = new Subject<string>();

target.innerHTML = rml`
  <button ${onenter}="${stream}">
`;

This might facilitate, abstract away or offer an alternative to some of the work currently performed by Event Adapters:

const OnEnterValue = inputPipe(
  filter(e=>e.key == 'Enter'),
  map(e=>e.target.value),
);

const stream = new Subject<string>();

target.innerHTML = rml`
  <button oninput="${ OnEnterValue( stream )}">
`;

More analysis required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions