Setting up with single type #89
Unanswered
Darkmagister
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You should not need to emit the data manually for any content types defined in the plugin config. If you want to listen for setting updates all that should be needed is the listener on the client side. socket.on('connect', () => {
socket.on('setting:update', (data) => {
console.log('settings updated!');
console.log(data);
});
}); In terms of the find action not working, it is not a supported action at this time. You can utilize the raw emit function if you still wish to emit it. Keep in mind that data will not be transformed in raw and will need to be done manually as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i'm using a single type in strapi to save some configurations, and i would like that when someone in strapi update those config to emit an event via socketio so that i can get the new values, i've installed the plugin and configure like this:
then in the lifecycles.js file of the single type i added this:
i used find as event here as setting.find is the only permission available to public (no auth needed for this)
for the client i will be using vue but for testing now i'm trying this:
https://addons.mozilla.org/en-US/firefox/addon/socketio-client/
when i connect i get the console with the id, but when i update the setting in strapi i get the console.log but no event on the client can anyone have any suggestion?
thanks
Beta Was this translation helpful? Give feedback.
All reactions