15 Matching Annotations
  1. Mar 2021
    1. var md = require('markdown-it')('commonmark');

      first sighting: require(...)(...)

      How would that work with import? Not as fluidly but...

      import markdownIt from 'markdown-it'
      let md = markdownIt('commonmark')
      
  2. Feb 2021
    1. Subprocess will try to match the nested ends’ semantics to the tracks it knows. You may wire custom ends using Output.
    1. I agre with your concern. I realy prefer to do this : form.assign_attributes(hash) if form.valid? my_service.update(form) #render something else #render somthing else end It looks more like a normal controller.
    1. Finally, you can use fields_for in order to create/edit associated fields and the suffix _list (like profile_list below) to choose an existing associated record.
    2. @user_form = UserForm.new(User.find(params[:id])) # you need to load the record being edited
    3. # Use relationship's name followed by "__" plus attribute's name # to validate has_one and belongs_to associations validates :name, :address__street, :company__name, presence: true
  3. Dec 2020
    1. page is a { host, path, params, query } object where host is the URL's host, path is its pathname, params is derived from path and the route filename, and query is an object of values in the query string.

      I like that we don't have to manually parse params/query out of the full request URI. It provides the data that you are most likely to need, in an readily/easily-usable form.

  4. Oct 2020
    1. You can set options.params to a POJO as shown above, or to an instance of the JavaScript's built-in URLSearchParams class. const params = new URLSearchParams([['answer', 42]]); const res = await axios.get('https://httpbin.org/get', { params });
  5. Sep 2020
  6. react-spectrum.adobe.com react-spectrum.adobe.com
    1. let {focusProps} = useFocus({ onFocus: (e) => setEvents((events) => [...events, 'focus']), onBlur: (e) => setEvents((events) => [...events, 'blur']), onFocusChange: (isFocused) => setEvents((events) => [...events, `focus change: ${isFocused}`]) });