Skip to content

Instantly share code, notes, and snippets.

class UserModel {
user = {
firstName: 'Jane',
middleName: 'Liz',
lastName: 'Doe',
};
getFullName({ short } = {}) {
const { firstName, middleName, lastName } = this.user;
if (short) return firstName + ' ' + lastName;
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);
["cat","act","tac","bat","tab","abt","atb","owl","low","olw"]
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)
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...