Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x,15.x]
node-version: [15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@

> Synchronize service events between application instances

<!-- TOC -->

- [Feathers sync](#feathers-sync)
- [About](#about)
- [Usage](#usage)
- [`app.sync`](#appsync)
- [Disabling synchronization](#disabling-synchronization)
- [Adapters](#adapters)
- [Redis](#redis)
- [AMQP](#amqp)
- [NATS](#nats)
- [How it works](#how-it-works)
- [Caveat: Listening to service events](#caveat-listening-to-service-events)
- [Custom Serializer / Deserializer](#custom-serializer--deserializer)
- [Writing custom adapters](#writing-custom-adapters)
- [License](#license)

<!-- /TOC -->

## About

When running multiple instances of your Feathers application (e.g. on several Heroku Dynos), service events (`created`, `updated`, `patched`, `removed` and any custom defined events) do not get propagated to other instances.
Expand Down Expand Up @@ -189,6 +208,6 @@ The `data` for the `sync-in` event should be in the same form as the one that is

## License

Copyright (c) 2019 Feathers contributors
Copyright (c) 2021 Feathers contributors

Licensed under the [MIT license](LICENSE).
10 changes: 7 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const adaptors = {
};

const { SYNC } = core;

module.exports = options => {
const init = options => {
const { uri, deserialize, serialize } = options;

if (!uri) {
Expand Down Expand Up @@ -45,4 +44,9 @@ module.exports = options => {
});
};

Object.assign(module.exports, adaptors, { SYNC });
module.exports = init;

Object.assign(module.exports, adaptors, {
default: init,
SYNC
});
Loading