(
initialData?: IObservableSetInitialValues<T>,
enhancer: IEnhancer<T> = deepEnhancer,
public name_ = __DEV__ ? "ObservableSet@" + getNextId() : "ObservableSet"
)
| 76 | enhancer_: (newV: any, oldV: any | undefined) => any |
| 77 | |
| 78 | constructor( |
| 79 | initialData?: IObservableSetInitialValues<T>, |
| 80 | enhancer: IEnhancer<T> = deepEnhancer, |
| 81 | public name_ = __DEV__ ? "ObservableSet@" + getNextId() : "ObservableSet" |
| 82 | ) { |
| 83 | if (!isFunction(Set)) { |
| 84 | die(22) |
| 85 | } |
| 86 | this.enhancer_ = (newV, oldV) => enhancer(newV, oldV, name_) |
| 87 | initObservable(() => { |
| 88 | this.atom_ = createAtom(this.name_) |
| 89 | if (initialData) { |
| 90 | this.replace(initialData) |
| 91 | } |
| 92 | }) |
| 93 | } |
| 94 | |
| 95 | private dehanceValue_<X extends T | undefined>(value: X): X { |
| 96 | if (this.dehancer !== undefined) { |
nothing calls this directly
no test coverage detected