goatslacker / goatslacker/alt

Uncaught TypeError: this.dispatch is not a function

Open
#630 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
3.4k
Forks
312
PR merge metrics
No merged PRs in 30d

Description

Is the TypeScript tutorial over at https://github.com/goatslacker/alt-tutorial/tree/master/src up to date? Getting some errors following that tutorial and wondering what I'm doing wrong. Trying to use to dispatcher but it apparently doesn't exist.

Typescript: 1.8.2

```
"use strict";
import alt = require("./alt");

/**
* AltJS Flux Actions implementation
{@link http://alt.js.org/guide/actions/} AltJS Actions
*/
class myActions implements AltJS.ActionsClass{
constructor(alt: AltJS.Alt) {

}

dispatch: (...payload: Array) => void;

myAction(payload : any): void {
this.dispatch(payload);
}

}

export = alt.createActions(myActions);
```

Contributor guide

Open the contributing guide

Research direction

Start with the TypeScript tutorial under https://github.com/goatslacker/alt-tutorial/tree/master/src and compare its ActionsClass and createActions usage with the AltJS API. Reproduce the reported this.dispatch error using TypeScript 1.8.2, then determine whether the tutorial needs correction or an explanation of the supported usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.