Created
May 15, 2018 09:51
-
-
Save ValeryVS/c9194afde3c665813e3707f87d5213b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BasePage() {} | |
BasePage.create = function(pageConstructor) { | |
return new pageConstructor(); | |
} | |
module.exports = BasePage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dog = require('./page.1'); | |
console.log(dog.name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dog = require('./page'); | |
console.log(dog.name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BasePage = require('./base-page'); | |
function Page() { | |
this.name = getName(); | |
} | |
module.exports = BasePage.create(Page); | |
const getName = () => 'Index'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BasePage = require('./base-page'); | |
function Page() { | |
this.name = getName(); | |
} | |
module.exports = BasePage.create(Page); | |
function getName() { | |
return 'Index'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment