You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add _.pickUp function to underscore object. This function (like _.pick function) returns a copy of the array, filtered to only have values for the whitelisted values (or array of values).
For example: _.pickUp(['yes', 'no', 'yep', 'nope'], true, false, true, false) returns ['yes', 'yep']
Allow to pass second parameter as an array of values: _.pi…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now you can use DOM-element contents as a template. Just pass DOM-element id (like '#dom-element-id') and all those element's contents (innerHTML) will used as a template string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Redux-based flux implementation with promises support
There is middleware.js that extends basic dispatcher to support promises. Each action with promise will dispatch 2 simple actions: one when request started (to show preloader) and another when request finished (with success or error).
action-creator.js is a simple example of how promise-actions is looks like: it is a plain object with 2 keys: promise and types.
store.js is a simple example of store (reducer) that contain both data and loading statuses for some data object. It listen 3 types of actions and changes data accordingly.
All works great until we try to implement growl-like notifications for each action.
Notifications
It is a simple store, that listen all success / error actions and push new notification into collection of notifications. It also support feature to hide notification (remove item by id from collection).
I would like to have notifications, that display only for a few seconds and then will dissapear. So, redux way is t