question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Move chain/can under commands

See original GitHub issue

I keep stumbling over the use of commands with and without chain/can:

// unchained
editor.commands.setBold()

// chained
editor.chain().setBold().run()

// unchained can
editor.can().setBold()

// chained can
editor.can().chain().setBold().run()

I’m thinking about whether chain/can should only available under commands:

// unchained
editor.commands.setBold()

// chained
editor.commands.chain().setBold().run()

// unchained can
editor.commands.can().setBold()

// chained can
editor.commands.can().chain().setBold().run()

What do you think? Or do you have other ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
samwilliscommented, Mar 1, 2021

I not sure I like that, the chains are rather lovely.

I think I would leave it as is for now and see how people get on, if you become inundated with new users getting it wrong then you can revisit it and always depreciate the current way of doing it.

They way I think of it is:

editor.commands: the raw commands

editor.can() & editor.chain() magic ways of using the commands

0reactions
hanspagelcommented, Sep 22, 2021

I’m closing this here as it feels like a non-issue for people. @philippkuehn feel free to reopen it, if you think we should change that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 6851: Internet Message Access Protocol (IMAP) - MOVE ...
This is accomplished by defining a new MOVE command and extending the UID command to allow UID MOVE. A move function is not...
Read more >
RFC 7151 - File Transfer Protocol HOST Command for Virtual ...
1. REIN Command Semantics As specified in [RFC959], the REIN command returns the state of the connection to what it was immediately after...
Read more >
The keytool Command - Oracle Help Center
The keytool command stores the keys and certificates in a keystore. ... Braces are also used around the -v , -rfc , and...
Read more >
BGP - RouterOS - MikroTik Documentation - Support
More information on BGP roles can be found in the corresponding RFC draft ... Also, in this menu is located a session-specific set...
Read more >
iptables - ArchWiki - Arch Linux
iptables is a command line utility for configuring Linux kernel firewall implemented within the Netfilter project. The term iptables is also ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found