Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buttons example and module #58

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

PebbleKat
Copy link
Contributor

Added Buttons example folder
Added Buttons to examples readme.md
Added module folder containing buttons.js

Please let me know if you think the readme on the buttons example is a bit light.

@PebbleKat PebbleKat changed the title Add buttons example and APIs Add buttons example and API Feb 10, 2016
obj.buttonHandler = {};

obj.onPress = function onPress(type, callback) {
this.buttonHandler[type] = callback;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore everything except Up, Down, Left, and Right

@HBehrens
Copy link
Contributor

The file symbols-manual.js is meant for all bindings to the transpiled.js that cannot be generated easily. For cases like yours where technically there's no dependency to the transpiled code at all and people would benefit from a "wearable-focused" API on top of WebAPIs, we would like to see small, reusable packages that will alter become NPM modules. Unfortunately, we don't have a good example for this ,yet (will happen next sprint).
Meanwhile, do you mind, moving your convenience wrapper into a separate in your example folder?

You hit the error because document is a WebAPI that doesn't exist in a node environment in which we run the tests.

@PebbleKat PebbleKat changed the title Add buttons example and API Add buttons example and module Feb 10, 2016
@PebbleKat
Copy link
Contributor Author

@HBehrens this should be ready to review now that I've removed the API from symbols-manual.js and created a module instead.

@HBehrens
Copy link
Contributor

I don't think we need the three butkus.* files.

};

(function() {
onPress("back", function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you put this logic into an anonymous function to not pollute the global namespace but currentText as well as rocky are still globals.

@PebbleKat
Copy link
Contributor Author

@HBehrens Ready for you to take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants