useOnUpdate method

loopic.useOnUpdate([dynamicId], [middlewareFunction])

  • dynamicId String
  • middlewareFunction Function
    • dynamicId String
    • value String
    • next Function


Method used for adding additional middleware functions to the update pipeline. Middleware functions will be called in the same order as they were added to the pipeline.

Middleware function receives dynamicId, the value and the reference to the next middleware function in the pipeline. Next function must be called if you want to execute all other middlewares left for that dynamic id. If you do not want to execute left middlewares, skip adding next() call.


loopic.useOnUpdate("_t1color", (id, value, next) => {
  const element = loopic.getElement("homeColor"); = value;