DailyJS

Morearty.js, ngDroplet

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries angularjs react

Morearty.js, ngDroplet

Posted by Alex R. Young on .
Featured

libraries angularjs react

Morearty.js, ngDroplet

Posted by Alex R. Young on .

Morearty.js

Marat Bektimirov sent in Morearty.js (GitHub: moreartyjs / moreartyjs, License: Apache 2.0, npm: morearty), a state management library inspired by Om. It's based on the immutable data structures in immutable.js -- the idea is components and subcomponents only have access to a nested version of data that is synchronised with the original binding. That means each component only knows what it should, which should improve encapsulation within the application.

Morearty detects any changes automatically and triggers re-rendering. Each component gets a correctly defined shouldComponentUpdate method that compares the component's state using straightforward JavaScript strict equals operator ===. So, only the components whose state was altered are re-rendered.

This might sound similar to Omniscient.js, which I wrote about recently. Omniscient could technically work with other immutable libraries, but is similar to Morearty. Libraries like these help you focus on generic state change operations so you don't get too bogged down in DOM structure.

Morearty's binding methods return this, so you should be able to chain calls. It comes with tests and has high test coverage.

ngDroplet

ngDroplet (GitHub: Wildhoney / ngDroplet, License: MIT, Bower: ng-droplet) by Adam Timberlake is a new HTML5 file uploading library for Angular that supports drag and drop and image previews. You can set the allowed extensions and show upload progress if your server sends the X-File-Size header.

It uses the custom droplet element or a data-droplet attribute, and it uses a DropletModel object that contains the metadata for selected files.