generates a factory function that binds a class-prototype-method func (by reference) to the passed object S (which should be an instance of the class).
Example
constbind_map_set = bindMethodFactory(Map.prototype.set) typeID = number constgraph_edges = newMap<ID, Set<ID>>() constset_graph_edge = bind_map_set(graph_edges) // automatic type inference will correctly assign it the type: `(key: number, value: Set<number>) => Map<number, Set<number>>` constedges: [ID, ID[]][] = [[1, [1,2,3]], [2, [3,5]], [3, [4, 7]], [4, [4,5]], [5, [7]]] for (const [id, adjacent_ids] ofedges) { set_graph_edge(id, newSet(adjacent_ids)) }
generates a factory function that binds a class-prototype-method
func
(by reference) to the passed objectS
(which should be an instance of the class).Example
example with assigned default arguments