In the process of overbuilding my behemoth business card widget, I put together or otherwise acquired a few well-generalized microlibraries that are now up on GitHub. You may find them useful!
If you fat-finger
git stats or
didYouMean.js is the product, and it makes it incredibly easy to compare a string to a list of strings. There are a bunch of hot-swappable options – a couple flavors of threshold, and a “good enough quit early” flag – and it will happily attach itself to
window or to
module.exports as available.
Whenever I venture out from within SproutCore’s thick, KVO-happy walls, the first thing I do is figure out how to keep disparate layers (ergo objects) in sync and active without having to know about each other. I was part of a VB.NET shop in a previous life, where it was custom class events; in node, everything is an EventEmitter; and of course it’s bindings in Cocoa, where SproutCore got the idea from in the first place.
For my project, I decided to go raw, no frameworks, no nothin’, but it turns out I can’t live without this one piece. Google this time directed me to Google, whose Maps API includes something called MVCObject, and to this project, a standalone implementation. Credit goes to two silent email addresses named “John” and “Mark”, @ an apparently dead website; they’ve apparently abandoned the project, so I’ve moved it to GitHub, added some examples to the README, and softened its habit of throwing cranky errors in otherwise-safe situations. When even Angular is too much, MVCObject.js is your framework-free framework!™