Closed Bug 1335776 Opened 9 years ago Closed 9 years ago

autoland-ui: Implement `resetPropsWithUpdates`-style function

Categories

(Conduit :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: davidwalsh, Assigned: davidwalsh)

Details

Attachments

(1 file)

To help manage state better (i.e. not do cleanup constantly), we should add something like a `resetPropsWithUpdates` method which combines default props with any updates needed.
Comment on attachment 8832495 [details] autoland-ui: Implement resetStateWithUpdates to cleaner state. Also whitespace cleanup. (Bug 1335776) https://reviewboard.mozilla.org/r/108752/#review109962 ::: autoland/ui/src/components/AutolandController.jsx:44 (Diff revision 2) > + }); > return; > } > > response.json().then(data => { > - this.setState({ data, error: null }); > + this.resetPropsWithUpdates({ data }); was wondering why `{data}` was valid instead of `{data: data}`, but, a little testing and googling led me to learn about http://eslint.org/docs/rules/object-shorthand. LGTM!
Attachment #8832495 - Flags: review?(imadueme) → review+
Comment on attachment 8832495 [details] autoland-ui: Implement resetStateWithUpdates to cleaner state. Also whitespace cleanup. (Bug 1335776) https://reviewboard.mozilla.org/r/108752/#review109988 Rubber stamp for landing.
Attachment #8832495 - Flags: review+
Comment on attachment 8832495 [details] autoland-ui: Implement resetStateWithUpdates to cleaner state. Also whitespace cleanup. (Bug 1335776) https://reviewboard.mozilla.org/r/108752/#review110016 Still looks good!
Pushed by mcote@mozilla.com: https://hg.mozilla.org/automation/conduit/rev/046fae9d9d38 autoland-ui: Implement resetStateWithUpdates to cleaner state. Also whitespace cleanup. r=imadueme,mcote
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Assignee: nobody → dwalsh
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: