Coder Social home page Coder Social logo

Comments (2)

mbroadst avatar mbroadst commented on September 27, 2024

@Bixibu this is sort of a weak point in the design unfortunately. Certain controllers behave differently, so your assumptions are not correct for the ListController. Generally, the json encoding actually occurs as part of the default send milestone: https://github.com/dchester/epilogue/blob/master/lib/Controllers/base.js#L67.

The 'data' milestone is not actually defined for any of the controllers by default, but you can assign a 'data' step in order to manipulate (or check) the data. That's probably where I would put my checks. As for why the "before" and "after" aren't called, well that's because there is nothing for there to be before or after! You need to define a data milestone, and then if you want to do something before that you can define a list.data.before

from epilogue.

mbroadst avatar mbroadst commented on September 27, 2024

In case that wasn't so clear above: if you want access to the generated JSON, we don't prepare that explicitly before sending a res.json in the send step. You can validate the context.instance at any point in your workflow, or you could actually set context.instance to the JSON yourself on a list.send.before step maybe?

from epilogue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.