Skip to content

Commit

Permalink
GuideEvents.md => cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Jun 24, 2024
1 parent 1984b64 commit fbe8747
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions resources/data/deck/learnneo/pages/GuideEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ class MainView extends Container {
items: [{
module : TextField,
labelText: 'Name',
listeners: {
<<<<<<< Updated upstream
click: button => Neo.Main.log('Click!')
=======
change : data => Neo.Main.log({value:data.value}),
>>>>>>> Stashed changes
listeners: {
change: data => Neo.Main.log({value:data.value})
}
}]
}
Expand All @@ -79,7 +75,7 @@ class MainView extends Container {
module : TextField,
labelText: 'Name',
listeners: {
change : 'up.foo'
change: 'up.foo'
}
}]
}
Expand All @@ -97,9 +93,9 @@ Any view class can specify a controller &mdash; wWhen the view is created a cont
also created.

<pre data-neo>
import Base from '../../../../src/controller/Component.mjs';
import Controller from '../../../../src/controller/Component.mjs';

class MainViewController extends Base {
class MainViewController extends Controller {
static config = {
className: 'Example.view.MainViewController',
}
Expand All @@ -125,7 +121,7 @@ class MainView extends Container {
module : TextField,
labelText: 'Name',
listeners: {
change : 'foo'
change: 'foo'
}
}]
}
Expand All @@ -141,9 +137,9 @@ a listener proccedurally.
Any obversable class has an `addListener` method, along with an easier-to-type version called `on`.

<pre data-neo>
import Base from '../../../../src/controller/Component.mjs';
import Controller from '../../../../src/controller/Component.mjs';

class MainViewController extends Base {
class MainViewController extends Controller {
static config = {
className: 'Example.view.MainViewController',
}
Expand Down Expand Up @@ -172,20 +168,20 @@ class MainView extends Container {
module : TextField,
labelText: 'Name',
listeners: {
change : 'foo'
change: 'foo'
}
}]
}
}
Neo.setupClass(MainView);
</pre>

The method specified in `on()` doen't have to be an arrow function; you can use a controller function.
The method specified in `on()` doesn't have to be an arrow function; you can use a controller function.

<pre data-neo>
import Base from '../../../../src/controller/Component.mjs';
import Controller from '../../../../src/controller/Component.mjs';

class MainViewController extends Base {
class MainViewController extends Controller {
static config = {
className: 'Example.view.MainViewController',
}
Expand Down

0 comments on commit fbe8747

Please sign in to comment.