Add flow type definition #20

Merged
merged 1 commit into from Feb 13, 2017

Projects

None yet

1 participant

@josh
Owner
josh commented Feb 11, 2017
@josh Add flow type definition
ee827a1
@josh josh requested review from mislav and dgraham Feb 11, 2017
@@ -0,0 +1,23 @@
+/* @flow */
+
+declare class SelectorSet<T: any> {
@josh
josh Feb 11, 2017 Owner

Declaring SelectorSet as a generic has a nice property of ensuring the opaque data you can store along with it is consistent.

const set = new SelectorSet();
set.add('.foo', 123);
set.matches(el)[0].data // number
@@ -0,0 +1,23 @@
+/* @flow */
+
@josh
josh Feb 11, 2017 Owner

Dear @github, it would be cool to highlight .flow as JavaScript.

@josh josh merged commit d54da56 into master Feb 13, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
@josh josh deleted the flow branch Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment