Incorporate signia as @tldraw/state (#1620)
It tried to get out but we're dragging it back in. This PR brings [signia](https://github.com/tldraw/signia) back into tldraw as @tldraw/state. ### Change Type - [x] major --------- Co-authored-by: David Sheldrick <d.j.sheldrick@gmail.com>
This commit is contained in:
parent
a4b5bcb8f7
commit
5cb08711c1
143 changed files with 5419 additions and 168 deletions
11
packages/state/src/lib/core/isSignal.ts
Normal file
11
packages/state/src/lib/core/isSignal.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { _Atom } from './Atom'
|
||||
import { _Computed } from './Computed'
|
||||
import { Signal } from './types'
|
||||
|
||||
/**
|
||||
* Returns true if the given value is a signal (either an Atom or a Computed).
|
||||
* @public
|
||||
*/
|
||||
export function isSignal(value: any): value is Signal<any> {
|
||||
return value instanceof _Atom || value instanceof _Computed
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue