Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add blockTypesData for additional props. #141

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 8, 2018

  1. [WIP] Add blockTypesData for additional props.

    Specify (optional) blockType-specific data to pass
    as props on render.
    
    # Motivation
    
    Imagine a component that selects from a list:
    
    ```
    {
      id: 'animals',
      label: 'Animals',
      component: Animals
    }
    ```
    
    You use 'animals' in many places. But then a new 
    component request comes in: it should be similar 
    to  'animals', but filter results to show only 
    warm-blooded animals. 
    
    Now you could create a brand new
    blockType, and that might be appropriate in 
    certain situations. But in many cases, it would be 
    simpler to reuse component logic with props.
    
    # Proposal
    
    Use a new bootstrap options key, `blockTypesData`,
    as a map of `blockType.id` keys. The value for
    each key is an object, which becomes a part of the
    `BlockType` as `data` and spread as props for the
    component.
    
    I'm open to approaching this in other ways. This 
    is a first pass that I hope helps to communicate 
    the end goal.
    cwmanning committed Nov 8, 2018
    Configuration menu
    Copy the full SHA
    8e7e3d3 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2019

  1. Configuration menu
    Copy the full SHA
    6230591 View commit details
    Browse the repository at this point in the history