mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-20 20:07:34 +00:00
23 lines
457 B
TypeScript
23 lines
457 B
TypeScript
import {makeObservable, observable, action} from 'mobx'
|
|
|
|
import type { StringMutator } from '../types'
|
|
|
|
class ObsStringMutator implements StringMutator {
|
|
|
|
_s: string | null
|
|
|
|
constructor(s: string) {
|
|
this._s = s
|
|
makeObservable(this, {
|
|
_s: observable,
|
|
set: action,
|
|
//get: computed .// no need
|
|
})
|
|
}
|
|
|
|
set(v: string | null): void { this._s = v }
|
|
get(): string | null { return this._s }
|
|
}
|
|
|
|
export default ObsStringMutator
|