Creates the array used for default columnsToSortBy state when the caller doesn't
provide one (mobx observable.array). Default: a WatchableArray.
Runs a group of state mutations as a single atomic action, so observers see one
change notification rather than several (mobx runInAction). Default: f().
Reactivity adapter
The list/tree/table components in this package re-render in response to state changes: changes to the selection, to the set of expanded parents, to the sort order, and (in apps built on an observability library) changes to the row data itself. Rather than depend on a particular state-management library, the components route all such behavior through a
ReactivityAdapter.The default adapter (
plainReactivityAdapter) has no dependencies: components re-render via ordinary React state updates, and collections created byobservableSet/observableArrayareWatchableSet/WatchableArrayinstances that notify the components using them. What the default adapter cannot do is detect mutations of plain Sets/arrays you pass as props, or mutations of row data; pass new object/collection instances (orWatchableSet/WatchableArray) when changing them from outside, as is normal in React.If your app uses MobX, call
setReactivityAdapter(mobxReactivityAdapter)(see therx-datatable/mobxentry point) once at startup, before rendering. Then all components behave asobservers: rows re-render when observable row data mutates, and you can passobservable.set/observable.arrayfor selection/expansion/sort state.Each adapter member is named after the MobX API it abstracts.