This file contains 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
class UserModel { | |
user = { | |
firstName: 'Jane', | |
middleName: 'Liz', | |
lastName: 'Doe', | |
}; | |
getFullName({ short } = {}) { | |
const { firstName, middleName, lastName } = this.user; | |
if (short) return firstName + ' ' + lastName; |
This file contains 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 useLogin(/* any context you want to pass in here */) { | |
const [data, setData] = useState(''); | |
const [error, setError] = useState(''); | |
const [loading, setLoading] = useState(''); | |
useEffect(() => { | |
async function login() { | |
try { | |
const val = await login(); | |
setData(val); |
This file contains 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
["cat","act","tac","bat","tab","abt","atb","owl","low","olw"] |
This file contains 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
class SomeForm extends Component { | |
state = { | |
email: '', | |
password: '', | |
}; | |
// - using arrow functions will auto-bind to 'this', so no need | |
// for doing this.updateFormField = this.updateFormField.bind(this) | |
// in the constructor (although there are some caveats to this | |
// approach when writing unit tests) |
This file contains 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
W, [2017-06-09T14:12:18.561678 #7708] WARN -- : [SKYLIGHT] [0.10.6] Running Skylight in development mode. No data will be reported until you deploy your app. | |
(To disable this message for all local apps, run `skylight disable_dev_warning`.) | |
== 20170605141824 AddSurveyableFlagToTopicCategories: migrating =============== | |
-- add_column(:topic_categories, :surveyable, :boolean, {:default=>:false}) | |
-> 0.0081s | |
rails aborted! | |
StandardError: An error has occurred, this and all later migrations canceled: | |
PG::UndefinedColumn: ERROR: column topic_categories.row_order does not exist | |
LINE 1: ...es" WHERE "topic_categories"."slug" = $1 ORDER BY "topic_cat... |