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:
Steve Ruiz 2023-06-20 14:31:26 +01:00 committed by GitHub
parent a4b5bcb8f7
commit 5cb08711c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
143 changed files with 5419 additions and 168 deletions

View 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
}