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

API naming changes #24

Open
MartinMalinda opened this issue Sep 30, 2020 · 0 comments
Open

API naming changes #24

MartinMalinda opened this issue Sep 30, 2020 · 0 comments
Labels
question Further information is requested

Comments

@MartinMalinda
Copy link
Owner

MartinMalinda commented Sep 30, 2020

vue-concurrency API initially started to be as close as possible to ember-concurrency for a few reasons:

  • it makes this library easy to understand for people who know ember-concurrency
  • it helps preserving the same philosophy and keep the lib on the same path as ember-concurrency

however, there are also some challenges:

value

value is a problematic property name for a task instance because it might make it look like a value from Ref is being accessed and that's not the case. result could be a reasonable alternative

instance

  • I'd argue that the term task instance is a bit confusing in ember-concurrency as well because it might imply that TaskInstance is some kind of instance of a Task class and that's not the case. In ember-concurrency Task + TaskInstance are both completely separate classes and instances are created from both of them (in the OOP sense). But in Ember this is still more tolerable because Ember is overall more OOP than Vue.
  • vue-concurrency is under the hood not written in OOP, it's plain functions
  • vue, especially vue 3 also turns rather towards functional programming (using hooks, avoiding classes, this). So coding beginners picking up Vue might have no OOP knowledge and the term Instance is not helpful to understand the concept.

It's harder to come up with a naming alternative here:

  • TaskRun task.runs...
  • TaskCall task.calls ...
  • TaskPerform task.performs

Neither of these seem great.

@MartinMalinda MartinMalinda added the question Further information is requested label Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant