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.

Decorators for compatability with vuex-module-decorators

See original GitHub issue

Would be great if we could do things like:


@Module
export default class Collection extends VuexModule {
  
  documents = [];

  @FirestoreAction
  bindCollection({ context }, name: string) {
    context.bindFirestoreRef('documents', db.collection(name));
    context.unbindFirestoreRef('documents');
  }
}

Would allow actions and state to be more true to how they look in Vanilla Vuex while also making them typesafe.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
tommyocommented, Aug 28, 2019

Now that I think about it, I agree - it doesn’t belong in this package. I wrote a very simple vuexfire-decorators as a separate package. I’ll release it as soon as it’s hardened.

when combined with vuex-module-decorators and typescript, your todo example (as a module) looks like:

@Module
export default class TodoState extends VuexModule {

  public todos: Todo[] = [];

  @FirestoreBind('todos')
  public bindTodosRef() {
    return db.collection('todos');
  }
}
0reactions
posvacommented, Oct 13, 2022

Closing as decorators for vue in terms of typings are being deprecated and there hasn’t been any activity.

If anybody publishes a lib, feel free to post it here

Read more comments on GitHub >

github_iconTop Results From Across the Web

championswimmer/vuex-module-decorators - GitHub
TypeScript/ES7 Decorators to create Vuex modules declaratively - GitHub ... There are major usage improvements (non backwards compatible) in 0.8.0.
Read more >
vuex-module-decorators - npm
Decorators to make class-like Vuex modules. Latest version: 2.0.0, last published: a year ago. Start using vuex-module-decorators in your ...
Read more >
Typescript/ES7 Decorators to make Vuex modules a breeze
Today I would like to show you a very useful tool written in TypeScript that can boost your productivity with Vuex: vuex-module-decorators.
Read more >
Getting Started | vuex-module-decorators - championswimmer
In your store, you use the MyModule class itself as a module. import Vuex from 'vuex' import MyModule from '~/store/mymodule' ...
Read more >
vuex-module-decorators versions and peer dependencies
Online Peer dependency version tool to search for compatible versions of related NPM packages.
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