Disable user hook in sails

不想你离开。 提交于 2019-12-05 19:39:39

Sails.js doesn't currently support disabling individual user hooks in the same way as the core hooks, although it certainly makes sense to implement that feature. In the meantime, the simplest thing to do is to just implement a toggle within the hook itself. In the defaults, provide an active key that defaults to true, and then in initialize, check that active is true before continuing. See sails-hook-autoreload for an example.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!