Skip to content

Feature/fix issue 9 - #11

Merged
robiseb merged 3 commits into
developfrom
feature/fix-issue-9
Feb 2, 2022
Merged

Feature/fix issue 9#11
robiseb merged 3 commits into
developfrom
feature/fix-issue-9

Conversation

@robiseb

@robiseb robiseb commented Jan 31, 2022

Copy link
Copy Markdown
Contributor

Feature #9 added.

It comes with a breaking change.

  • data-call.params refers to custom parameters and is waiting a JSON format. This parameter is optional.
  • Old $el and $event are deprecated. Those parameters are now automatically passed to the callback method.

Full exemple:

<button data-call="modal#register.open" data-call.params='[{ "myAttr": "myValue" }]'>do something</button>

<div id="register" is="modal">
  Some HTML
</div>
modulus.component('modal', class extends Component {
  run() {
    // ...
  }
  /**
   * Open modal and do some stuff
   *
   * @params {HTMLElement} el
   * @params {Event} e
   * @params {Object|null} [data]
   */
  open({ el, e, data }) {
    // el: <button ...>
    // e: Event{ ... }
    // data: { ... } | null
  }

@robiseb
robiseb merged commit 686b51f into develop Feb 2, 2022
@robiseb
robiseb deleted the feature/fix-issue-9 branch February 2, 2022 08:51
@robiseb robiseb mentioned this pull request Feb 15, 2022
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.

1 participant