Skip to content
vic

mazelab/angular-kefir

Angular module to handle the reactive streams from Kefir.js

mazelab/angular-kefir.json
{
"createdAt": "2015-05-05T01:18:00Z",
"defaultBranch": "master",
"description": "Angular module to handle the reactive streams from Kefir.js",
"fullName": "mazelab/angular-kefir",
"homepage": null,
"language": "JavaScript",
"name": "angular-kefir",
"pushedAt": "2015-05-08T18:22:35Z",
"stargazersCount": 3,
"topics": [],
"updatedAt": "2017-12-11T22:15:26Z",
"url": "https://github.com/mazelab/angular-kefir"
}

Angular module to handle more reactive with streams from Kefir.js

This module is based of the angular-frp project from xgrommx.

##Installation

bower install --save angular-kefir

View evens to controller stuff:

$scope.$fromWatch('searchQuery')
.debounce(250)
.map(function(x) {return x.newValue})
.skipWhile(function(x) {return (typeof x == 'undefined') || x === ''})
.skipDuplicates()
.onValue(searchSubscriber)

Socket.IO response to the view.

Service file:

.factory('socket', [function() {
var socket = io.connect('/gui');
return socket;
}])
.factory('changedItemsResponse', ['socket', function(socket) {
var res_ = Kefir.fromEvent(socket, 'history:changedItems');
return res_;
}])

Controller:

changedItemsResponse.$assignProperty($scope, 'items');