Ask HN: Libraries that define interfaces similar to “Iterable”?
In JS, to implement Iterable, you expose an iterator on the property [Symbol.iterator]. Are there any libraries/frameworks/whatever which define interfaces this way, so that many packages can implement them? This could create interoperability opportunities around a shared collection of "-ables" or "capabilities". As an example, there could be a Serializable interface which expects a Seralizer interface to be implemented at [Library.seralizerSymbol].
It seems like a standard, concise set of such interfaces could ease package interoperability and module interfacing in general if adopted by a significant number of packages.
Open to feedback, and please let me know if this already exists.
0 comments
[ 3.0 ms ] story [ 12.2 ms ] threadNo comments yet.