Last active
December 29, 2015 09:09
-
-
Save bradgignac/7647856 to your computer and use it in GitHub Desktop.
Servo Boolean Observable
This file contains hidden or 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
| goog.provide('servo.boolean'); | |
| goog.require('servo.observable'); | |
| servo.boolean = function (value, options) { | |
| return servo.observable(value, function (value) { | |
| return typeof value === 'boolean'; | |
| }, options); | |
| }; |
This file contains hidden or 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
| goog.provide('servo.string'); | |
| goog.require('servo.observable'); | |
| servo.string = function (value, options) { | |
| return servo.observable(value, function (value) { | |
| return typeof value === 'string'; | |
| }, options); | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example Usage: