0.7.1 • Published 2 years ago

bgio-effects v0.7.1

Weekly downloads
79
License
SEE LICENSE IN LI...
Repository
github
Last release
2 years ago

bgio-effects

NPM Version Build Status Coverage Status

📤 Helpers for managing state effects in boardgame.io.

This package provides a structured approach to triggering ephemeral “effects” in game code that can be consumed from state on the client. It provides a game plugin and a client-side extension that emits events for your effects.

💾 Installation

npm i bgio-effects

👀 At a glance

Call effects from your moves or other game code:

function move(G, ctx) {
  ctx.effects.explode();
}

Listen for effects on the client:

const onExplode = () => {
  // render explosion/play sound/etc.
};

// With the plain JS emitter
emitter.on('explode', onExplode);

// With the React hook
useEffectListener('explode', onExplode, []);

📚 Documentation

See the full documentation website →

🙌 Contributing

This is an experimental project and feedback is welcome. Please open an issue if you run into any problems, have a question, or want to suggest features/improvements. PRs are welcome too 😊.

Please also note the code of conduct and be kind to each other.

📄 License

The code in this repository is provided under the terms of an Anti-Fascist MIT License.

0.7.1

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago