This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { Component } from 'react'; | |
| export default function HOCBaseRender<Props, State, ComponentState>( | |
| Comp: new() => Component<Props & State, ComponentState>) { | |
| return class HOCBase extends Component<Props, State> { | |
| render() { | |
| return <Comp {...this.props} {...this.state}/>; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # coding=utf-8 | |
| # "DATASHEET": http://cl.ly/ekot | |
| from __future__ import print_function | |
| import serial, struct, sys, time | |
| DEBUG = 1 | |
| CMD_MODE = 2 | |
| CMD_QUERY_DATA = 4 | |
| CMD_DEVICE_ID = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # coding=utf-8 | |
| # "DATASHEET": http://cl.ly/ekot | |
| from __future__ import print_function | |
| import serial, struct, sys, time | |
| DEBUG = 1 | |
| CMD_MODE = 2 | |
| CMD_QUERY_DATA = 4 | |
| CMD_DEVICE_ID = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Used by Flavor to mark a type in a readable way. */ | |
| export interface Flavoring<FlavorT> { | |
| _type?: FlavorT; | |
| } | |
| /** Create a "flavored" version of a type. TypeScript will disallow mixing flavors, but will allow unflavored values of that type to be passed in where a flavored version is expected. This is a less restrictive form of branding. */ | |
| export type Flavor<T, FlavorT> = T & Flavoring<FlavorT>; | |
| /** Used by Brand to mark a type in a readable way. */ | |
| export interface Branding<BrandT> { | |
| _type: BrandT; |
OlderNewer