multistream-select icon indicating copy to clipboard operation
multistream-select copied to clipboard

Update Docs + API - matchingFunc

Open jbenet opened this issue 8 years ago • 0 comments

Update Docs + API after the matchingFunc discussion. We discussed:

  • multistream takes in a tuple: (multicodec-header, handlerFunc, matchingFunc)
  • handlerFunc is called with the header
  • matchingFunc decides whether a header matches.
  • default matchingFunc is equivalence (tests the given header matches the original one)
// something like this
type matchingFunc func(h multicodecHeader) bool
type handlerFunc func(h multicodecHeader, s io.Stream)

jbenet avatar Aug 06 '16 04:08 jbenet