-
-
Save dmtw/19aa5f144df80ad14866 to your computer and use it in GitHub Desktop.
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
angular.module('app.services') | |
.factory('Nsfw', function ($rootScope) { | |
'use strict'; | |
var _nsfw = false; | |
var broadcastNsfw = function (nsfw) { | |
$rootScope.$broadcast('Nsfw.Update', nsfw); | |
}; | |
var toggleNsfw = function () { | |
_nsfw = !_nsfw; | |
broadcastNsfw(_nsfw); | |
}; | |
return { | |
toggleNsfw: toggleNsfw, | |
nsfw: _nsfw | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment