You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we support returning INVALID_MOVE from moves to bail out of a state update. There are circumstances where a plugin might also want to flag that an action is invalid. For example, a plugin that validates state or — as came up in #957 (review) — in the events plugin if there is an error processing the event queue.
This would probably look something like the current noClient plugin method. A plugin could declare an isInvalid method that could return any truthy value to invalidate the current action.
constplugin={name: 'validator',isInvalid: ({ G })=>{if(typeofG.value!==number){return{error: 'G.value must be a number'};}},};
Once we have something like #723, plugin errors could be added to the possible error types and the return value of isInvalid returned to the client for debugging.
The text was updated successfully, but these errors were encountered:
Currently we support returning
INVALID_MOVE
from moves to bail out of a state update. There are circumstances where a plugin might also want to flag that an action is invalid. For example, a plugin that validates state or — as came up in #957 (review) — in the events plugin if there is an error processing the event queue.This would probably look something like the current
noClient
plugin method. A plugin could declare anisInvalid
method that could return any truthy value to invalidate the current action.Once we have something like #723, plugin errors could be added to the possible error types and the return value of
isInvalid
returned to the client for debugging.The text was updated successfully, but these errors were encountered: