syndicate-js/packages/syndicatec/examples/javascript/src/client.js

12 lines
351 B
JavaScript

/// 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) => send message SetBox(v + 1);
on retracted BoxState(_) => console.log('box gone');
}
}