syndicate-js/packages/syndicatec/examples/typescript/src/client.ts

12 lines
371 B
TypeScript

/// SPDX-License-Identifier: GPL-3.0-or-later
/// SPDX-FileCopyrightText: Copyright © 2016-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
import { BoxState, SetBox } from './protocol.js';
boot {
spawn named 'client' {
on asserted BoxState($v: number) => send message SetBox(v + 1);
on retracted BoxState(_) => console.log('box gone');
}
}