Skip to content

Instantly share code, notes, and snippets.

View 4nte's full-sized avatar
🧃
yum

Ante Gulin 4nte

🧃
yum
View GitHub Profile
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\Administrator\Ubuntu", "User")
import Composer from 'react-composer';
<Composer
components={[
<CurrencyConsumer/>,
<LocaleConsumer />,
<ThemeConsumer/>
]}>
{([currency, locale, theme]) => (
<MyComponent currency={currency} locale={locale} theme ={theme} />
import Composer from 'react-composer';
<Composer
components={[
<CurrencyConsumer/>,
<LocaleConsumer />,
<ThemeConsumer/>
]}>
{([currency, locale, theme]) => (
<MyComponent currency={currency} locale={locale} theme ={theme} />
// @flow
import React from 'react';
import { render } from 'react-dom';
import { Provider, Subscribe, Container } from 'unstated';
type CounterState = {
count: number
};
class CounterContainer extends Container<CounterState> {
const { Provider, Consumer } = React.createContext("Scuba Manager");
render() {
return (
<Provider value="Scrum Master">
<Consumer>
{ (userRole) => <span>Role: {userRole}</span> /* <span>Role: Scrum Master</span>*/}
</Consumer>
</Provider>
)
const { Provider, Consumer } = React.createContext("Scuba Manager");
render() {
return (
<Provider>
<Consumer>
{ (userRole) => <span>Role: {userRole}</span> }
</Consumer>
</Provider>
)
const {Provider, Consumer} = React.createContext(defaultValue);
const {Provider, Consumer} = React.createContext(defaultValue);