Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.eslintrc.yml
.gitignore
README.md
index.js
package-lock.json
package.json

README.md

Multimethods in JavaScript

This is a project I created while learning about Clojure. Multimethods seem pretty cool and I wanted implement them in JavaScript to learn more about them & understand them better, i.e. Just For Fun.

Features

Basic

  • register (attach) methods
  • dispatch to methods

More general stuff

  • de-register (detach) methods [2018-05-23]
  • default method [2018-05-23]

Dispatch hierarchy

  • "derive" method ("is a" type hierarchy of dispatch types) [2018-06-19]
  • resolve a child type to a parent type for function dispatch [2018-06-19]

Multiple dispatch!!

  • basic 2-item dispatch
  • each item respects hierarchy

Utility

  • get methods map
  • get dispatcher
  • "handles" function to see if a call is handle-able (what to do if there's a default method?) [2018-06-19]

"Phase II" 😏

  • Underive
  • method to pass a dispatch hierarchy in/replace one (for sharing) (low priority)
  • get dispatch hierarchy
  • replace methods (hold on this 'til later; not currently clear it's a problem to just allow methods to be overwritten)
You can’t perform that action at this time.