Skip to content

Instantly share code, notes, and snippets.

@WarrenAdams8
WarrenAdams8 / code-editor-rules.md
Created December 20, 2024 14:28 — forked from yifanzz/code-editor-rules.md
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
import { BehaviorSubject, Subject, combineLatest } from 'rxjs'
import { useState, useEffect } from 'react'
import { skip, filter } from 'rxjs/operators'
export const useSharedState = <T>(
defaultState: T,
subject: Subject<T>
): [T, typeof useState] => {
const [value, setState] = useState(defaultState)
useEffect(() => {