Skip to content

Instantly share code, notes, and snippets.

View sledsworth's full-sized avatar

Steven Ledsworth sledsworth

View GitHub Profile
@sledsworth
sledsworth / customElementDocGenerator.ts
Last active November 5, 2019 18:49
Support for custom-elements.json File Generation for StencilJS Components
/**
* Stencil Doc Outputs don't seem to support custom-elements.json as suggested
* here: https://github.com/w3c/webcomponents/issues/776#issuecomment-536749457.
* This generator implements this standard, which is used by Storybook to display
* documentation.
*/
export async function generateJsonDocs(config, compilerCtx, _buildCtx, docsData) {
const jsonOutputTargets = config.outputTargets.filter(isOutputTargetCustomElementDocsJson);
const { components, ...docsDataWithoutComponents } = docsData;
const json = {
@sledsworth
sledsworth / NutrientModel.swift
Last active April 17, 2021 16:48
Generic Animated Progress Bar in SwiftUI
import Foundation
import UIKit
import SwiftUI
import Combine
class NutrientModel: Progressable {
var willChange = PassthroughSubject<BaseNutrient, Never>()
var id = UUID.init()
var name: String