Skip to content

Commit c5fa5ae

Browse files
author
Anthony Du Pont
committed
🎨 Rename init method to setup method
1 parent 533940a commit c5fa5ae

File tree

18 files changed

+26
-25
lines changed

18 files changed

+26
-25
lines changed

.eslintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"no-await-in-loop": 2,
2626
"no-compare-neg-zero": 2,
2727
"no-cond-assign": 2,
28-
"no-console": 2,
28+
"no-console": 0,
2929
"no-constant-condition": [2, { "checkLoops": false }],
3030
"no-debugger": 2,
3131
"no-dupe-args": 2,
@@ -69,7 +69,7 @@
6969
"no-empty-function": 1,
7070
"no-empty-pattern": 1,
7171
"no-eq-null": 1,
72-
"no-eval": 2,
72+
"no-eval": 0,
7373
"no-extend-native": 2,
7474
"no-extra-bind": 1,
7575
"no-extra-label": 1,
@@ -85,7 +85,7 @@
8585
"no-loop-func": 2,
8686
"no-multi-spaces": 1,
8787
"no-multi-str": 1,
88-
"no-new-func": 2,
88+
"no-new-func": 0,
8989
"no-new-wrappers": 1,
9090
"no-octal": 1,
9191
"no-octal-escape": 1,

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ This example supports:
328328
- :sparkles: Improve events
329329
- :sparkles: Improve transitions
330330
- :sparkles: Improve documentation
331+
- :art: Rename renderers `init` method to `setup` method
331332
- :bug: Fix events
332333
- :bug: Fix helpers
333334

dist/es5/highway.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,8 @@ function () {
10201020

10211021

10221022
_createClass(Renderer, [{
1023-
key: "init",
1024-
value: function init() {
1023+
key: "setup",
1024+
value: function setup() {
10251025
// We call the `onEnter` and `onEnterCompleted` methods of the renderer on
10261026
// initialization if they exists.
10271027
this.onEnter && this.onEnter();
@@ -4100,11 +4100,11 @@ function (_Emitter) {
41004100

41014101
_this.cache = new Map(); // Status variables.
41024102

4103-
_this.navigating = false; // Get the page renderer and properly initialize it.
4103+
_this.navigating = false; // Get the page renderer and properly setup it.
41044104

41054105
_this.From = new (_helpers.default.getRenderer(_this.props.slug, _this.renderers))(_this.props);
41064106

4107-
_this.From.init(); // Events
4107+
_this.From.setup(); // Events
41084108

41094109

41104110
_this._click = _this.click.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Listen the `popstate` on the window to run the router each time an

dist/es5/highway.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es5/highway.min.js.gz

1 Byte
Binary file not shown.

dist/highway.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class Renderer {
201201
/**
202202
* Renderer initialization.
203203
*/
204-
init() {
204+
setup() {
205205
// We call the `onEnter` and `onEnterCompleted` methods of the renderer on
206206
// initialization if they exists.
207207
this.onEnter && this.onEnter();
@@ -490,9 +490,9 @@ class core_Core extends tiny_emitter_default.a {
490490
// Status variables.
491491
this.navigating = false;
492492

493-
// Get the page renderer and properly initialize it.
493+
// Get the page renderer and properly setup it.
494494
this.From = new (helpers_Helpers.getRenderer(this.props.slug, this.renderers))(this.props);
495-
this.From.init();
495+
this.From.setup();
496496

497497
// Events
498498
this._click = this.click.bind(this);

dist/highway.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/highway.min.js.gz

1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)