UNPKG

422 BJavaScriptView Raw
1// Note: This file is used by the file ./index.js
2
3function factory (type, config, load, typed) {
4 // create a new typed function using MyType
5 // when imported in math.js, this will extend the
6 // existing function `add` with support for MyType
7 return typed('add', {
8 'MyType, MyType': function (a, b) {
9 return new type.MyType(a.value + b.value)
10 }
11 })
12}
13
14exports.name = 'add'
15exports.factory = factory