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

Make NFCPushOptions optional for pushMessage #82

Closed
alexshalamov opened this issue Oct 30, 2015 · 3 comments
Closed

Make NFCPushOptions optional for pushMessage #82

alexshalamov opened this issue Oct 30, 2015 · 3 comments

Comments

@alexshalamov
Copy link

In my opinion, by making NFCPushOptions optional, we can improve API usability and developers would need to type less code for main use-cases.

pushMessage(message);

// Instead of

pushMessage(message, {target: "tag", timeout: Infinity});
@zolkis
Copy link
Contributor

zolkis commented Oct 30, 2015

If we can have sensible defaults, why not.
I expect that most of the pushes will be done to peers, and tags are much more often read than written.
If we need to set default values, then I am inclined to make "peer" the default target for a push.

Timeout could be set to Infinity as a default.

@zolkis
Copy link
Contributor

zolkis commented Oct 30, 2015

We could also separate push (to peers) from write (to tags).
Then we could say

nfc.push(message1);
nfc.write(message2);

zolkis added a commit to zolkis/web-nfc that referenced this issue Nov 4, 2015
…3c#84. Handle push related TAG review comments: simplified and aligned push message, optional push options with sensible defaults, improved push and cancelPush steps, option for suspending watches during push(), editorials.
@zolkis
Copy link
Contributor

zolkis commented Nov 6, 2015

Fixed by #88.

@zolkis zolkis closed this as completed Nov 6, 2015
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

No branches or pull requests

2 participants